-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
61 lines (39 loc) · 1.35 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
CC=gcc
WARNINGFLAGS = -Wall -Wextra -Wstrict-overflow=5 -Wunused-parameter \
-Wmissing-parameter-type -Wlogical-op -Wfloat-equal -Wpointer-arith \
-Wshadow -Wstrict-prototypes -Wwrite-strings -Wmissing-noreturn \
-Wmissing-prototypes -Wparentheses
INCLUDEFLAGS=
LINKFLAGS=
CFLAGS = -g -pthread -O2 -std=gnu99 -D_GNU_SOURCE $(WARNINGFLAGS) $(INCLUDEFLAGS)
SOBJ = open_noatime.so librvutils.so.1.0
OBJ = tailq_sort.o jenkins_hash.o graph.o clique.o tmppool.o
PROG = quickstat
TESTPROG = tailq_sort_test
depsdir = deps.d
depssuffix = deps
-include $(patsubst %,$(depsdir)/%,$(OBJ:.o=.$(depssuffix)))
.PHONY: all test
all: $(SOBJ) librvutils.a $(PROG)
test: $(TESTPROG)
@for x in $(TESTPROG) ; do \
./$$x < /dev/null ; \
done
$(depsdir):
mkdir -p $@
%.so: %.c | $(depsdir)
$(CC) $(CFLAGS) -shared -fPIC -MMD -MF $(depsdir)/$*.$(depssuffix) -o $@ $< $(LINKFLAGS)
%.o: %.c | $(depsdir)
$(CC) $(CFLAGS) -fPIC -MMD -MF $(depsdir)/$*.$(depssuffix) -c -o $@ $<
%: %.c
$(CC) $(CFLAGS) -o $@ $^ $(LINKFLAGS)
librvutils.so.1.0: $(OBJ)
$(CC) -shared -Wl,-soname,librvutils.so.1 -o $@ $^ $(LINKFLAGS)
librvutils.a: $(OBJ)
ar -rcs $@ $^
open_noatime.so: LINKFLAGS += -ldl
quickstat: LINKFLAGS += -lm -lgsl -lgslcblas
tailq_sort_test: tailq_sort.o
tailq_sort_test: LINKFLAGS += -lm
maximal_cliques: graph.o clique.o jenkins_hash.o
graphcomponents: graph.o jenkins_hash.o