aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 0b66d0d9f6358f3410556c2d74040d00d8b95ca0 (plain)
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

BINPATH = /usr/local/bin
MANPATH = /usr/local/share/man

stdu : stdu.o intmath.o intmath.h config-parser.h config-parser.o formatting.o \
       formatting.h
	cc -lm -O3 -o stdu stdu.o intmath.o config-parser.o formatting.o

stdu.o : stdu.c
	cc -O3 -c stdu.c

formatting.o : formatting.h formatting.c intmath.h intmath.c minitest.h
	cc -O3 -c formatting.c

intmath.o : intmath.c minitest.h intmath.h
	cc -O3 -c intmath.c

config-parser.o : config-parser.c config-parser.h minitest.h
	cc -O3 -c config-parser.c

tests : tests.c minitest.h intmath.c config-parser.c formatting.c
	cc -lm -O3 -o tests tests.c

test : tests 
	./tests


.PHONY: clean cleanall install uninstall

install : stdu
	mkdir -p ${BINPATH}
	cp -f stdu ${BINPATH}
	chmod 755 ${BINPATH}/stdu
	mkdir -p ${MANPATH}/man1
	cp -f stdu.1 ${MANPATH}/man1
	chmod 644 ${MANPATH}/man1/stdu.1

uninstall :
	-rm -f ${BINPATH}/stdu
	-rm -f ${MANPATH}/man1/stdu.1

clean :
	-rm stdu.o intmath.o tests config-parser.o formatting.o

cleanall: clean
	-rm stdu