Compare commits

...

8 Commits
2.0.3 ... 2.0.4

Author SHA1 Message Date
Lukáš Mešťan
ad50a915b0 Merge pull request #60 from loonies/makefile
Makefile improvements
2019-02-04 14:05:28 +01:00
Miodrag Tokić
88f970632f Add man page to reinstall target
Update man page on reinstall as well. Also remove unnecessary uninstall
as the "install" command handles this gracefully.
2019-02-04 12:42:21 +01:00
Miodrag Tokić
7f3220abb7 Remove unnecessary Git alias
Git is able to find binary by the prefixed "git" name.
2019-02-04 12:41:22 +01:00
Miodrag Tokić
7a9e9c7f85 Improve man install / uninstall
- Create man directory prior to installing the page
 - Do not force root ownership of the man page
 - Remove man page when uninstalling
2019-02-03 18:10:06 +01:00
Miodrag Tokić
190ae631e5 Straightforward binary removal
Remove binary using the full path instead of jumping to directory.
2019-02-03 18:06:31 +01:00
Miodrag Tokić
94ea505dbd Replace "mkdir" with "install"
Favour "install" over "mkdir" in installation scripts.
2019-02-03 18:04:13 +01:00
Miodrag Tokić
601986fbe1 Remove EXEC_FILES
Variable doesn't make much sense and makes the code more convoluted.
2019-02-03 17:57:28 +01:00
Miodrag Tokić
01f60821ea Help formatting 2019-02-03 17:44:18 +01:00

View File

@@ -1,12 +1,11 @@
PREFIX ?= /usr/local
TASK_DONE = echo -e "\n✓ $@ done\n"
# files that need mode 755
EXEC_FILES=git-quick-stats
.PHONY: test
all:
@echo "usage: make install"
@echo "Usage:"
@echo " make install"
@echo " make reinstall"
@echo " make uninstall"
@echo " make test"
@@ -16,27 +15,25 @@ help:
@$(TASK_DONE)
install:
mkdir -p $(PREFIX)/bin
install -m 0755 $(EXEC_FILES) $(PREFIX)/bin/$(EXEC_FILES)
git config --global alias.quick-stats '! $(PREFIX)/bin/$(EXEC_FILES)'
install -d -m 0755 $(PREFIX)/bin
install -m 0755 git-quick-stats $(PREFIX)/bin/git-quick-stats
$(MAKE) man
@$(TASK_DONE)
uninstall:
test -d $(PREFIX)/bin && \
cd $(PREFIX)/bin && \
rm -f $(EXEC_FILES) && \
git config --global --unset alias.quick-stats
rm -f $(PREFIX)/bin/git-quick-stats
rm -f $(PREFIX)/share/man/man1/git-quick-stats.1
@$(TASK_DONE)
reinstall:
@curl -s https://raw.githubusercontent.com/arzzen/git-quick-stats/master/git-quick-stats > git-quick-stats
$(MAKE) uninstall && \
@curl -sO https://raw.githubusercontent.com/arzzen/git-quick-stats/master/git-quick-stats
@curl -sO https://raw.githubusercontent.com/arzzen/git-quick-stats/master/git-quick-stats.1
$(MAKE) install
@$(TASK_DONE)
man:
install -g 0 -o 0 -m 0644 git-quick-stats.1 /usr/share/man/man1/
install -d -m 0755 $(PREFIX)/share/man/man1/
install -m 0644 git-quick-stats.1 $(PREFIX)/share/man/man1/
test:
tests/commands_test.sh