-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
65 lines (46 loc) · 1.3 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
TARGETS=main debruijn_graph
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
CXXFLAGS = -Wall $(DEBUG) $(PROFILE) $(OPT) $(ARCH) -m64 -I. -Wno-unused-result -Wno-strict-aliasing -Wno-unused-function
LDFLAGS = $(DEBUG) $(PROFILE) $(OPT) -lpthread -lssl -lcrypto -lboost_system -lboost_thread -lm -lbz2 -lz
#
# declaration of dependencies
#
all: $(TARGETS)
# dependencies between programs and .o files
main: main.o hashutil.o threadsafe-gqf/gqf.o
debruijn_graph: debruijn_graph.o hashutil.o threadsafe-gqf/gqf.o
# dependencies between .o files and .h files
main.o: threadsafe-gqf/gqf.h hashutil.h chunk.h kmer.h reader.h
debruijn_graph.o: debruijn_graph.h threadsafe-gqf/gqf.h hashutil.h
hashutil.o: hashutil.h
# dependencies between .o files and .cc (or .c) files
%.o: %.cc
threadsafe-gqf/gqf.o: threadsafe-gqf/gqf.c threadsafe-gqf/gqf.h
#
# generic build rules
#
$(TARGETS):
$(LD) $^ $(LDFLAGS) -o $@
%.o: %.cc
$(CXX) $(CXXFLAGS) $(INCLUDE) $< -c -o $@
%.o: %.c
$(CC) $(CXXFLAGS) $(INCLUDE) $< -c -o $@
clean:
rm -f *.o threadsafe-gqf/gqf.o $(TARGETS)