fix compile
[c11concurrency-benchmarks.git] / silo / masstree / GNUmakefile
1 AR = ar
2 CC = gcc
3 CXX = g++
4 CFLAGS = -g -O3
5 DEPSDIR := .deps
6 DEPCFLAGS = -MD -MF $(DEPSDIR)/$*.d -MP
7 ifeq ($(strip $(MEMMGR)), )
8   MEMMGR = -ljemalloc
9 endif
10 ifneq ($(strip $(KEYSWAP)), )
11   CFLAGS += -DKEYSWAP
12 endif
13 ifneq ($(strip $(NOPREFETCH)), )
14   CFLAGS += -DNOPREFETCH
15 endif
16 ifneq ($(strip $(NOSUPERPAGE)), )
17   CFLAGS += -DNOSUPERPAGE
18 endif
19 LIBS = -lnuma  -lpthread -lm
20 LDFLAGS = 
21
22 all: test_atomics mtd mtclient mttest
23
24 %.o: %.c config.h $(DEPSDIR)/stamp
25         $(CXX) $(CFLAGS) $(DEPCFLAGS) -include config.h -c -o $@ $<
26
27 %.o: %.cc config.h $(DEPSDIR)/stamp
28         $(CXX) $(CFLAGS) $(DEPCFLAGS) -include config.h -c -o $@ $<
29
30 %.S: %.o
31         objdump -S $< > $@
32
33 libjson.a: json.o string.o straccum.o str.o msgpack.o \
34         clp.o kvrandom.o compiler.o kvthread.o
35         @/bin/rm -f $@
36         $(AR) cru $@ $^
37
38 KVTREES = query_masstree.o \
39         value_string.o value_array.o value_versioned_array.o \
40         string_slice.o
41
42 mtd: mtd.o log.o checkpoint.o file.o misc.o $(KVTREES) \
43         kvio.o libjson.a
44         $(CXX) $(CFLAGS) -o $@ $^ $(MEMMGR) $(LDFLAGS) $(LIBS)
45
46 mtclient: mtclient.o misc.o testrunner.o kvio.o libjson.a
47         $(CXX) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
48
49 mttest: mttest.o misc.o checkpoint.o $(KVTREES) testrunner.o \
50         kvio.o libjson.a
51         $(CXX) $(CFLAGS) -o $@ $^ $(MEMMGR) $(LDFLAGS) $(LIBS)
52
53 test_string: test_string.o string.o straccum.o compiler.o
54         $(CXX) $(CFLAGS) -o $@ $^ $(MEMMGR) $(LDFLAGS) $(LIBS)
55
56 test_atomics: test_atomics.o string.o straccum.o kvrandom.o \
57         json.o compiler.o kvio.o
58         $(CXX) $(CFLAGS) -o $@ $^ $(MEMMGR) $(LDFLAGS) $(LIBS)
59
60 jsontest: jsontest.o string.o straccum.o json.o compiler.o
61         $(CXX) $(CFLAGS) -o $@ $^ $(MEMMGR) $(LDFLAGS) $(LIBS)
62
63 msgpacktest: msgpacktest.o string.o straccum.o json.o compiler.o msgpack.o
64         $(CXX) $(CFLAGS) -o $@ $^ $(MEMMGR) $(LDFLAGS) $(LIBS)
65
66 config.h: stamp-h
67
68 GNUmakefile: GNUmakefile.in config.status
69         CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
70
71 configure config.h.in: configure.ac
72         autoreconf -i
73         touch config.h.in
74
75 config.status: configure
76         ./configure  '--enable-max-key-len=1024' '--disable-assertions' '--disable-invariants' '--disable-preconditions' '--with-malloc=jemalloc'
77
78 $(DEPSDIR)/stamp:
79         mkdir -p $(DEPSDIR)
80         touch $@
81
82 stamp-h: config.h.in config.status
83         CONFIG_FILES= $(SHELL) ./config.status
84         echo > stamp-h
85
86 clean:
87         rm -f mtd mtclient mttest test_string test_atomics *.o libjson.a
88         rm -rf .deps
89
90 DEPFILES := $(wildcard $(DEPSDIR)/*.d)
91 ifneq ($(DEPFILES),)
92 include $(DEPFILES)
93 endif
94
95 .PHONY: clean all