-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
90 lines (56 loc) · 1.88 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
84
85
86
87
88
89
90
TARGETS=main libMQF.a
TESTFILES = tests/CountingTests.o tests/HighLevelFunctionsTests.o tests/IOTests.o tests/tagTests.o tests/bufferedCountingTests.o tests/onDiskCountingTests.o
ifdef D
DEBUG=-g
OPT=
else
DEBUG=
OPT=-Ofast
endif
ifdef NH
ARCH=
else
ARCH=-msse4.2 -D__SSE4_2_
endif
ifdef P
PROFILE=-pg -no-pie # for bug in gprof.
endif
CXX = g++ -std=c++11
CC = g++ -std=c++11
LD= g++ -std=c++11
INCLUDE= -I ThirdParty/stxxl/include/ -I ThirdParty/stxxl/build/include/
CXXFLAGS = -fPIC -Wall $(DEBUG) $(PROFILE) $(OPT) $(ARCH) $(INCLUDE) -fpermissive -fopenmp -m64 -I. -Wno-unused-result -Wno-strict-aliasing -Wno-unused-function -Wno-sign-compare
#STXXL= -L ThirdParty/stxxl/build/lib/ -llibstxxl
STXXL= ThirdParty/stxxl/build/lib/libstxxl.a
LDFLAGS = -fopenmp $(DEBUG) $(PROFILE) $(OPT)
#
# declaration of dependencies
#
all: $(TARGETS)
OBJS= gqf.o utils.o bufferedMQF.o onDiskMQF.o
# dependencies between programs and .o files
main: main.o $(STXXL) $(OBJS)
$(LD) $^ $(LDFLAGS) -o $@ $(STXXL)
# dependencies between .o files and .h files
libgqf.so: $(OBJS)
$(LD) $^ $(LDFLAGS) --shared -o $@
test: $(TESTFILES) gqf.c test.o utils.o
$(LD) $(LDFLAGS) -DTEST -o mqf_test test.o LayeredMQF.o bufferedMQF.o onDiskMQF.o utils.o $(TESTFILES) gqf.c $(STXXL)
main.o: gqf.h
libMQF.a: $(STXXL) $(OBJS)
ar rcs libMQF.a $(OBJS) $(STXXL)
# dependencies between .o files and .cc (or .c) files
$(STXXL):
mkdir -p ThirdParty/stxxl/build
cd ThirdParty/stxxl/build && cmake DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./ ..
cd ThirdParty/stxxl/build && make all install
gqf.o: gqf.c gqf.h
bufferedMQF.o: bufferedMQF.cpp bufferedMQF.h
%.o: %.cc
$(CXX) $(CXXFLAGS) $(INCLUDE) $< -c -o $@
%.o: %.c %.h
$(CC) $(CXXFLAGS) $(INCLUDE) $< -c -o $@
%.o: %.cpp %.hpp
$(CXX) $(CXXFLAGS) $(INCLUDE) $< -c -o $@
clean:
rm -f $(OBJS) $(TARGETS) $(TESTS) $(TESTFILES)