From 7c6b9b01e47d1d56c797d7ff48ede96708d16006 Mon Sep 17 00:00:00 2001 From: Lukas Mestan Date: Mon, 4 Sep 2017 12:01:34 +0200 Subject: [PATCH] update makefile --- Makefile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index ff5426d..f6bf6cb 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,10 @@ -prefix=/usr/local - +PREFIX=/usr/local +TASK_DONE = echo "\n✓ $@ done\n" # files that need mode 755 EXEC_FILES=git-quick-stats +.PHONY: test + all: @echo "usage: make install" @echo " make reinstall" @@ -11,21 +13,26 @@ all: help: $(MAKE) all + @$(TASK_DONE) install: - install -m 0755 $(EXEC_FILES) $(prefix)/bin - git config --global alias.quick-stats '! $(prefix)/bin/$(EXEC_FILES)' + install -m 0755 $(EXEC_FILES) $(PREFIX)/bin + git config --global alias.quick-stats '! $(PREFIX)/bin/$(EXEC_FILES)' + @$(TASK_DONE) uninstall: - test -d $(prefix)/bin && \ - cd $(prefix)/bin && \ + test -d $(PREFIX)/bin && \ + cd $(PREFIX)/bin && \ rm -f $(EXEC_FILES) && \ git config --global --unset alias.quick-stats + @$(TASK_DONE) reinstall: - git pull origin master + @curl -s https://raw.githubusercontent.com/arzzen/git-quick-stats/master/git-quick-stats > git-quick-stats $(MAKE) uninstall && \ $(MAKE) install + @$(TASK_DONE) test: tests/commands_test.sh + @$(TASK_DONE)