-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (25 loc) · 871 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
# sensible defaults for an insane world
CC := clang
CFLAGS := -Wall -g
LD := clang
LDFLAGS := -lc
hr: usage.c version.c hr.o
$(LD) $(LDFLAGS) -o hr hr.o
# builds the version, based on changes to things we care about
version.c: hr.c usage.txt
echo "/** Created on $(shell date) */" > version.c
echo "#define VERSION (\"$(shell git describe --abbrev=4 --dirty --always --tags)\")" >> version.c
# builds the command line argument processor from the usage definition
usage.c: docopt.c/docopt_c.py usage.txt
python docopt.c/docopt_c.py -o usage.c usage.txt
# downloads the DocOpt Python C generator
# @see https://github.com/docopt/docopt.c
docopt.c/docopt_c.py:
rm -rf docopt.c
git clone https://github.com/docopt/docopt.c.git
# now all the phony automation targets
.PHONY: clean pristine
clean:
rm -rf usage.c version.c hr.o hr
pristine: clean
rm -rf docopt.c