aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: f1979907cb4432b1433c3bf56d7ebbb302cbfa92 (plain) (blame)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.POSIX:

CONFIGFILE = config.mk
include $(CONFIGFILE)

DIGITS =\
	mongo_0.h mongo_1.h mongo_2.h mongo_3.h mongo_4.h \
	mongo_5.h mongo_6.h mongo_7.h mongo_8.h mongo_9.h \
	mongo_c.h

all: mongoclock

mongoclock: mongoclock.o
	$(CC) -o $@ $^ $(LDFLAGS)

mongoclock.o: mongoclock.c arg.h $(DIGITS)
	$(CC) -c -o $@ mongoclock.c $(CPPFLAGS) $(CFLAGS)

mongo_0.h: digit.sh
	./digit.sh 0 > $@

mongo_1.h: digit.sh
	./digit.sh 1 > $@

mongo_2.h: digit.sh
	./digit.sh 2 > $@

mongo_3.h: digit.sh
	./digit.sh 3 > $@

mongo_4.h: digit.sh
	./digit.sh 4 > $@

mongo_5.h: digit.sh
	./digit.sh 5 > $@

mongo_6.h: digit.sh
	./digit.sh 6 > $@

mongo_7.h: digit.sh
	./digit.sh 7 > $@

mongo_8.h: digit.sh
	./digit.sh 8 > $@

mongo_9.h: digit.sh
	./digit.sh 9 > $@

mongo_c.h: digit.sh
	./digit.sh c > $@

install: mongoclock
	mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
	mkdir -p -- "$(DESTDIR)$(PREFIX)/share/licenses/mongoclock"
	mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1"
	cp -- mongoclock "$(DESTDIR)$(PREFIX)/bin/"
	cp -- LICENSE "$(DESTDIR)$(PREFIX)/share/licenses/mongoclock/"
	cp -- mongoclock.1 "$(DESTDIR)$(MANPREFIX)/man1/"

uninstall:
	-rm -- "$(DESTDIR)$(PREFIX)/bin/mongoclock"
	-rm -- "$(DESTDIR)$(MANPREFIX)/man1/mongoclock.1"
	-rm -r -- "$(DESTDIR)$(PREFIX)/share/licenses/mongoclock"

clean:
	-rm -f -- *.o mongoclock mongo_*.h

.PHONY: all install uninstall clean