Debian Codegraph @

makefile

raw ◀ ▶
1 Debian patch touch this file
1 #COMPILER MODE C++11
2 CXX=g++ -std=c++11
3
4 #HTSLIB LIBRARY [SPECIFY YOUR OWN PATHS]
5 HTSLIB_INC=$(HOME)/Tools/htslib-1.11
•6 HTSLIB_LIB=-lhts
7
8 #BOOST IOSTREAM & PROGRAM_OPTION LIBRARIES [SPECIFY YOUR OWN PATHS]
9 BOOST_INC=/usr/include
•10 BOOST_LIB_IO=-lboost_iostreams
11 BOOST_LIB_PO=-lboost_program_options
12
13 #HTSLIB LIBRARY [SPECIFY YOUR OWN PATHS]
14 #HTSLIB_INC=/software/UHTS/Analysis/samtools/1.4/include
15 #HTSLIB_LIB=/software/UHTS/Analysis/samtools/1.4/lib64/libhts.a
16
17 #BOOST IOSTREAM & PROGRAM_OPTION LIBRARIES [SPECIFY YOUR OWN PATHS]
18 #BOOST_INC=/software/include
19 #BOOST_LIB_IO=/software/lib64/libboost_iostreams.a
20 #BOOST_LIB_PO=/software/lib64/libboost_program_options.a
21
22 #COMPILER & LINKER FLAGS
23
24 #Best performance is achieved with this. Use it if running on the same plateform you're compiling.
25 #CXXFLAG=-O3 -march=native
26
27 #Good performance and portable on most CPUs
•28 #CXXFLAG=-O3 -mavx2 -mfma
29
30 #Portable version without avx2 (much slower)
•31 CXXFLAG=$(CPPFLAGS) $(CXXFLAGS) -O3
32 LDFLAG=$(LDFLAGS) -O3
33
34
35 #DYNAMIC LIBRARIES
36 DYN_LIBS=-lz -lbz2 -lm -lpthread -llzma -lcurl -lssl -lcrypto
37
38 #SHAPEIT SOURCES & BINARY
39 BFILE=bin/shapeit4.2
40 HFILE=$(shell find src -name *.h)
41 CFILE=$(shell find src -name *.cpp)
42 OFILE=$(shell for file in `find src -name *.cpp`; do echo obj/$$(basename $$file .cpp).o; done)
43 VPATH=$(shell for file in `find src -name *.cpp`; do echo $$(dirname $$file); done)
44
45 #COMPILATION RULES
46 all: $(BFILE)
47
48 $(BFILE): $(OFILE)
49 $(CXX) $(LDFLAG) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) -o $@ $(DYN_LIBS)
50
51 obj/%.o: %.cpp $(HFILE)
52 $(CXX) $(CXXFLAG) -c $< -o $@ -Isrc -I$(HTSLIB_INC) -I$(BOOST_INC)
53
54 clean:
55 rm -f obj/*.o $(BFILE)