-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (33 loc) · 1.07 KB
/
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
40
41
42
43
VERSION = 0.0.3
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
TALLY = ./tally.bash
help:
@echo "Usage:"
@echo " make instal Install to PREFIX ($(PREFIX))"
@echo " make install-home Install to $(HOME)/.local"
@echo " make dist Create release tarball"
@echo " make check Run tests"
@echo " make clean Remove generated files"
install:
install -Dpm0755 $(TALLY) $(DESTDIR)$(BINDIR)/tally
uninstall:
rm -f $(DESTDIR)$(BINDIR)/tally
install-home:
@$(MAKE) --no-print-directory install PREFIX=~/.local
dist:
mkdir -p tally-$(VERSION)
cp -r tally.bash tally.lua Makefile README.md test/ tally-$(VERSION)
tar -czf tally-$(VERSION).tar.gz tally-$(VERSION)
rm -rf tally-$(VERSION)
check: test/expected.txt
@$(TALLY) test | diff -su0 $< -
@printf "\e[1;32mAll tests passed\e[0m\n"
benchmark:
@echo -n 'tally.lua: '
@time -f '%es' ./tally.lua >/dev/null
@echo -n 'tally.bash: '
@time -f '%es' ./tally.bash >/dev/null
clean:
rm -f *.tar.gz
.PHONY: help install uninstall install-home dist check benchmark clean