forked from dellytools/svprops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (33 loc) · 1.02 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
DEBUG ?= 0
# Submodules
PWD = $(shell pwd)
SEQTK_ROOT = ${PWD}/src/htslib/
# Flags
CXX=g++
CXXFLAGS += -isystem ${SEQTK_ROOT} -pedantic -W -Wall -Wno-unknown-pragmas
LDFLAGS += -L${SEQTK_ROOT} -lz -lhts -Wl,-rpath,${SEQTK_ROOT}
# Additional flags for release/debug
ifeq (${DEBUG}, 1)
CXXFLAGS += -g -O0 -fno-inline -DDEBUG
else ifeq (${DEBUG}, 2)
CXXFLAGS += -g -O0 -fno-inline -DPROFILE
LDFLAGS += -lprofiler -ltcmalloc
else
CXXFLAGS += -O9 -DNDEBUG
#LDFLAGS += --static
endif
# External sources
HTSLIBSOURCES = $(wildcard src/htslib/htslib/*.c) $(wildcard src/htslib/htslib/*.h)
SVSOURCES = $(wildcard src/*.h) $(wildcard src/*.cpp)
# Targets
TARGETS = .htslib src/svprops src/sampleprops
all: $(TARGETS)
.htslib: $(HTSLIBSOURCES)
cd src/htslib && make && cd ../../ && touch .htslib
src/svprops: .htslib $(SVSOURCES)
$(CXX) $(CXXFLAGS) $@.cpp -o $@ $(LDFLAGS)
src/sampleprops: .htslib $(SVSOURCES)
$(CXX) $(CXXFLAGS) $@.cpp -o $@ $(LDFLAGS)
clean:
cd src/htslib && make clean
rm -f $(TARGETS) $(TARGETS:=.o) .htslib