-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile.static
62 lines (48 loc) · 1.88 KB
/
Makefile.static
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
# To compile statistically on your machine, set up correctly the variables INC_MATH, INC_BOOST, LIB_RMATH, LIB_BPO, LIB_BIO
# before running "make -f Makefile.static"
#compiler
CXX=g++ -std=c++11
#internal paths
VPATH=$(shell for file in `find src -name *.cpp`; do echo $$(dirname $$file); done)
PATH_TABX=lib/Tabix
PATH_EIGN=lib/Eigen
#compiler flags
CXXFLAG_OPTI=-O3 -D_FAST_CORRELATION
CXXFLAG_WARN=-Wall -Wextra -Wno-sign-compare
#linker flags
LDFLAG_OPTI=-O3
#includes
INC_BASE=-Isrc -I$(PATH_TABX) -I$(PATH_EIGN)
INC_MATH=-I/xchip/gtex/francois/R-3.2.4/src/include/
INC_BOOST=-I/broad/software/free/Linux/redhat_6_x86_64/pkgs/boost_1.55.0/
INC_GSL=-I/broad/software/free/Linux/redhat_6_x86_64/pkgs/gsl_1.16/
#libraries
LIB_BASE=-Wl,-Bstatic -lz -lblas -lbz2 -lgsl -lgslcblas -Wl,-Bdynamic -lm
LIB_TABX=$(PATH_TABX)/libtabix.a
LIB_RMATH=/xchip/gtex/francois/R-3.2.4/src/nmath/standalone/libRmath.a
LIB_BPO=/broad/software/free/Linux/redhat_6_x86_64/pkgs/boost_1.55.0/lib/libboost_program_options.a
LIB_BIO=/broad/software/free/Linux/redhat_6_x86_64/pkgs/boost_1.55.0/lib/libboost_iostreams.a
#files (binary, objects, headers & sources)
FILE_BIN=bin/fastQTL.static
FILE_O=$(shell for file in `find src -name *.cpp`; do echo obj/$$(basename $$file .cpp).o; done)
FILE_H=$(shell find src -name *.h)
FILE_CPP=$(shell find src -name *.cpp)
#default
all: linux
#linux release
linux: CXXFLAG=$(CXXFLAG_OPTI) $(CXXFLAG_WARN)
linux: IFLAG=$(INC_BASE) $(INC_MATH) $(INC_BOOST) $(INC_GSL)
linux: LIB=$(LIB_RMATH) $(LIB_BPO) $(LIB_BIO) $(LIB_TABX) $(LIB_BASE) $(LIB_GSL)
linux: LDFLAG=$(LDFLAG_OPTI)
linux: $(FILE_BIN)
#compilation
$(LIB_TABX):
cd $(PATH_TABX) && make && cd ../..
$(FILE_BIN): $(FILE_O) $(LIB_TABX)
$(CXX) $(LDFLAG) $^ $(LIB) -o $@
obj/%.o: %.cpp $(FILE_H)
$(CXX) $(CXXFLAG) -o $@ -c $< $(IFLAG)
clean:
rm -f obj/*.o $(FILE_BIN)
cleanall: clean
cd $(PATH_TABX) && make clean && cd ../..