-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
84 lines (65 loc) · 2.21 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
MASTER_DIR=$(shell pwd)
OBJ_DIR=$(MASTER_DIR)/obj
BIN_DIR=$(MASTER_DIR)/bin
LIB=$(MASTER_DIR)/lib
AUTOCONF = autoconf
AUTOHEADER = autoheader
CFLAGS:=
ifeq ($(mode), debug)
CFLAGS:=$(CFLAGS) -O0 -g -DDEBUG
else
CFLAGS:=$(CFLAGS) -O3
endif
CXXFLAGS:=-std=c++11 $(CFLAGS)
export $(CFLAGS)
export $(CXXFLAGS)
SOURCES = main.cpp src/GrabJellyfishKmer.cpp src/GetCnvSignal.cpp src/GenerateKmer.cpp src/CallHmm.cpp src/EstimateCoverage.cpp
PROGRAM=$(BIN_DIR)/JAX-CNV
UMDHMM_SRC= $(LIB)/umdhmm-v1.02/backward.c \
$(LIB)/umdhmm-v1.02/baum.c \
$(LIB)/umdhmm-v1.02/forward.c \
$(LIB)/umdhmm-v1.02/hmmrand.c \
$(LIB)/umdhmm-v1.02/hmmutils.c \
$(LIB)/umdhmm-v1.02/nrutil.c \
$(LIB)/umdhmm-v1.02/sequence.c \
$(LIB)/umdhmm-v1.02/viterbi.c
INCLUDE = -I lib/jellyfish-2.2.6/include -I lib/fastaq/include/ -I lib/ -I lib/htslib/ -I include/
LIBRARY = -lz -lcurl -lbz2 -lpthread -lssl -lcrypto $(LIB)/fastaq/obj/*.o $(LIB)/jellyfish-2.2.6/lib/*.o \
$(patsubst %.c, %.o, $(UMDHMM_SRC) )
JELLYFISH=$(LIB)/jellyfish-2.2.6/bin/jellyfish
HTS_LIB=$(LIB)/htslib/libhts.a
all: $(PROGRAM)
.PHONY: all
$(PROGRAM): fastaq umdhmm $(JELLYFISH) $(HTS_LIB) $(SOURCES)
@mkdir -p $(BIN_DIR)
@$(CXX) $(CXXFLAGS) -o $@ $(SOURCES) $(UMDHMM_SRC) $(INCLUDE) $(HTS_LIB) $(LIBRARY)
.PHONY: all
clean:
@rm -rf $(OBJ_DIR) $(BIN_DIR)
$(MAKE) clean -C $(LIB)/fastaq
@rm -rf $(LIB)/jellyfish-2.2.6
$(MAKE) clean -C $(LIB)/umdhmm-v1.02
.PHONY: clean
$(OBJ_DIR):
@mkdir -p $(OBJ_DIR)
$(BIN_DIR):
@mkdir -p $(BIN_DIR)
fastaq:
@echo "- Building in fastaq"
@$(MAKE) --no-print-directory --directory=$(LIB)/fastaq
umdhmm:
@echo "- Building in umdhmm"
@$(MAKE) --no-print-directory --directory=$(LIB)/umdhmm-v1.02
$(JELLYFISH):
@echo "- Building in jellyfish"
@cd $(LIB) && tar -zxvf $(LIB)/jellyfish-2.2.6.tar.gz
@cd $(LIB)/jellyfish-2.2.6 && ./configure --prefix=$(LIB)/jellyfish-2.2.6
$(MAKE) --no-print-directory --directory=$(LIB)/jellyfish-2.2.6
@mkdir -p $(BIN_DIR)
@cp $(JELLYFISH) $(BIN_DIR)
$(HTS_LIB):
@echo "- Building in htslib"
@rm -f $(LIB)/htslib/configure
@rm -rf $(LIB)/htslib/autom4te.cache
@cd $(LIB)/htslib && $(AUTOHEADER) && $(AUTOCONF) && ./configure --disable-lzma --disable-lcurl
$(MAKE) --no-print-directory -C $(LIB)/htslib