-
-
Notifications
You must be signed in to change notification settings - Fork 247
/
Makefile
39 lines (32 loc) · 837 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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 " make reinstall"
@echo " make uninstall"
@echo " make test"
help:
$(MAKE) all
@$(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)'
@$(TASK_DONE)
uninstall:
test -d $(PREFIX)/bin && \
cd $(PREFIX)/bin && \
rm -f $(EXEC_FILES) && \
git config --global --unset alias.quick-stats
@$(TASK_DONE)
reinstall:
@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)