-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
84 lines (48 loc) · 1.28 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
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#SRC = $(wildcard src/*.c)
SRC = $(wildcard deps/*.c)
OBJ = $(SRC:.c=.o)
PREFIX=/usr/local
CARGS = -std=c99
INCLUDE = -I deps -I src
BIN=datafun
all: aggregate map reduce search
### aggregate
aggregate: mean sum
mean:
$(CC) $(SRC) src/aggregate/[email protected] $(CARGS) $(INCLUDE) -o ./bin/$@
#mode:
# $(CC) $(SRC) src/aggregate/mode.c $(CARGS) $(INCLUDE) -o ./bin/$@
sum:
$(CC) $(SRC) src/aggregate/[email protected] $(CARGS) $(INCLUDE) -o ./bin/$@
### map
map: abs
abs:
$(CC) $(SRC) src/map/[email protected] $(CARGS) $(INCLUDE) -o ./bin/$@
### reduce
reduce: gt gte lt lte splitlines
gt:
$(CC) $(SRC) src/reduce/[email protected] $(CARGS) $(INCLUDE) -o ./bin/$@
gte:
$(CC) $(SRC) src/reduce/[email protected] $(CARGS) $(INCLUDE) -o ./bin/$@
lt:
$(CC) $(SRC) src/reduce/[email protected] $(CARGS) $(INCLUDE) -o ./bin/$@
lte:
$(CC) $(SRC) src/reduce/[email protected] $(CARGS) $(INCLUDE) -o ./bin/$@
splitlines:
$(CC) $(SRC) src/reduce/[email protected] $(CARGS) $(INCLUDE) -o ./bin/$@
### search
search: max min
max:
$(CC) $(SRC) src/search/[email protected] $(CARGS) $(INCLUDE) -o ./bin/$@
min:
$(CC) $(SRC) src/search/[email protected] $(CARGS) $(INCLUDE) -o ./bin/$@
### UTILS
install:
ls -tr bin/* | xargs -t -I {} install {} $(PREFIX)/bin/.
uninstall:
ls bin | xargs -t -I {} rm $(PREFIX)/bin/{}
clean:
rm -f ./bin/*
test:
./test/test.sh
.PHONY: clean install uninstall test