-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (28 loc) · 829 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
40
41
42
43
cc=gcc
flags=-Wall
libs=-lm -lpthread -lgmp
FIXDIR=fixtures/
run: main.out
./main.out
testrun: test.out
./test.out
scratchesrun: scratches.out
./scratches.out
main.out: utils.o point.o main.c
$(cc) $(flags) $(libs) -o main.out $^
# fixtures/test_is_within_circle.csv is an order-only prerequisite
test.out: utils.o point.o test.c | fixtures/test_is_within_circle.csv
$(cc) $(flags) $(libs) -o test.out $^
scratches.out: utils.o point.o scratches.c
$(cc) $(flags) $(libs) -o scratches.out $^
utils.o: utils.h utils.c
$(cc) $(flags) -c utils.c
point.o: point.h point.c
$(cc) $(flags) -c point.c
fixtures/test_is_within_circle.csv: fixtures.py
python3.6 ./fixtures.py
clean: *.o *.out
rm $^
todo:
grep --color -PRi -C 3 --exclude=[mM]akefile --exclude=*.sw[op] to-do
.PHONY: run testrun scratchesrun clean