-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
92 lines (74 loc) · 3.14 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
91
92
CXX=g++
RM=rm -rf
#include directories seperated by a space
INC=./utils/include/
INC_PARAMS=$(foreach d, $(INC), -I$d)
#lib directories seperated by a space
LIB=./utils/lib/
LIB_PARAMS=$(foreach d, $(LIB), -L$d)
#paramaters as suggested by seqan
CXXLAGS=$(INC_PARAMS) -std=c++14 -O3 -DNDEBUG -DSEQAN_HAS_ZLIB=1 -DSEQAN_HAS_BZIP2=1 -DSEQAN_DISABLE_VERSION_CHECK=YES -W -Wall -pedantic
#Parameters for debug purposes. Comment the above line and out the below one to compile in debug mode
#CXXLAGS=$(INC_PARAMS) -std=c++14 -g -O0 -DSEQAN_ENABLE_DEBUG=1 -DSEQAN_HAS_ZLIB=1 -DSEQAN_HAS_BZIP2=1 -DSEQAN_DISABLE_VERSION_CHECK=YES -W -Wall -pedantic
LDFLAGS=
LDLIBS=$(LIB_PARAMS) -lz -lbz2
ifeq ($(OS),Windows_NT)
CXXLAGS += -D WIN32
ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
CXXLAGS=/W2 /wd4996 -D_CRT_SECURE_NO_WARNINGS
else
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
CXXLAGS=/W2 /wd4996 -D_CRT_SECURE_NO_WARNINGS
endif
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
CXXLAGS=/W2 /wd4996 -D_CRT_SECURE_NO_WARNINGS
endif
endif
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CXXLAGS += -fopenmp
LDLIBS += -lpthread -lrt -lgomp
endif
ifeq ($(UNAME_S),Darwin)
CXXLAGS +=
endif
endif
#can add many src files if it is necessary in future (by putting spaces)
SRC= ./src/HMMDecoder.cpp ./src/HMMTrainer.cpp ./src/HMMGraph.cpp ./src/Polisher.cpp ./src/main.cpp
OBJS=$(subst .cpp,.o,$(SRC))
default: all
all: $(OBJS)
mkdir -p ./bin/
$(CXX) $(LDFLAGS) -o ./bin/apollo $(OBJS) $(LDLIBS)
./src/main.o: ./src/Polisher.o ./src/main.cpp ./src/CommandLineParser.h
$(CXX) $(CXXLAGS) -c -o ./src/main.o ./src/main.cpp
./src/Polisher.o: ./src/HMMDecoder.o ./src/HMMTrainer.o ./src/HMMGraph.o ./src/Polisher.cpp ./src/Polisher.h
$(CXX) $(CXXLAGS) -c -o ./src/Polisher.o ./src/Polisher.cpp
./src/HMMDecoder.o: ./src/HMMGraph.o ./src/HMMDecoder.cpp ./src/HMMDecoder.h
$(CXX) $(CXXLAGS) -c -o ./src/HMMDecoder.o ./src/HMMDecoder.cpp
./src/HMMTrainer.o: ./src/HMMGraph.o ./src/HMMTrainer.cpp ./src/HMMTrainer.h
$(CXX) $(CXXLAGS) -c -o ./src/HMMTrainer.o ./src/HMMTrainer.cpp
./src/HMMGraph.o: ./src/HMMGraph.cpp ./src/HMMGraph.h ./src/HMMCommons.h ./utils/lib/libz.a ./utils/lib/libbz2.a ./utils/include/seqan/basic.h
$(CXX) $(CXXLAGS) -c -o ./src/HMMGraph.o ./src/HMMGraph.cpp
./utils/lib/libz.a: ./utils/zlib-1.2.11.tar.gz
mkdir -p ./utils/include/
mkdir -p ./utils/lib/
tar -xf ./utils/zlib-1.2.11.tar.gz -C ./utils/
cd ./utils/zlib-1.2.11/; prefix=./ ./configure; make install prefix=../
rm -rf ./utils/zlib-1.2.11/
./utils/lib/libbz2.a: ./utils/bzip2-1.0.6.tar.gz
mkdir -p ./utils/include/
mkdir -p ./utils/lib/
tar -xf ./utils/bzip2-1.0.6.tar.gz -C ./utils/
cd ./utils/bzip2-1.0.6/; make install PREFIX=../
rm -rf ./utils/bzip2-1.0.6/
./utils/include/seqan/basic.h: ./utils/seqan.tar.gz
rm -rf ./utils/include/seqan/
mkdir -p ./utils/include/
mkdir -p ./utils/lib/
tar -xzf ./utils/seqan.tar.gz -C ./utils/
mv ./utils/seqan ./utils/include/
# rm -rf ./utils/seqan-library-2.4.0
clean:
$(RM) $(OBJS) ./bin/ ./utils/include/ ./utils/lib/ ./utils/share/ ./utils/man/ ./utils/bin/