-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
133 lines (98 loc) · 3.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
CC ?= gcc
CXX ?= g++
INCS :=
LIBS := -lz -lm -lpthread
CFLAGS :=
#CXXFLAGS := -Wall $(INCS) -std=c++14
CXXFLAGS := $(INCS) -std=c++14
SRCDIR := src
LIBDIR := lib
OBJDIR := obj
MRSDIR := $(SRCDIR)/mrsfast
EXE := circminer
SRCEXT := cpp
MYSRC = circminer.cpp \
utils.cpp \
output.cpp \
filter.cpp \
match_read.cpp \
fastq_parser.cpp \
commandline_parser.cpp \
chain.cpp \
gene_annotation.cpp \
align.cpp \
common.cpp \
hash_table.cpp \
process_circ.cpp \
extend.cpp \
genome.cpp \
edlib.cpp \
MRSOBJ = $(MRSDIR)/$(OBJDIR)/*.o
SOURCES = $(patsubst %, $(SRCDIR)/%, $(MYSRC))
MYOBJ = $(SOURCES:$(SRCDIR)/%.$(SRCEXT)=$(OBJDIR)/%.o)
MRSLIBDIR = $(LIBDIR)/mrsfast
MRS_CP_FILES := Common.c \
Common.h \
RefGenome.c \
RefGenome.h \
MRS_SRC_FILES := $(addprefix $(MRSDIR)/, $(MRS_CP_FILES))
EDLIB_LIB_HED_PATH = $(LIBDIR)/edlib/edlib/include/edlib.h
EDLIB_LIB_SRC_PATH = $(LIBDIR)/edlib/edlib/src/edlib.cpp
EDLIB_SRC_PATH = $(SRCDIR)/edlib.cpp
EDLIB_HED_PATH = $(SRCDIR)/edlib.h
LOGGER_LIB_HED_PATH = $(LIBDIR)/util-logger/include/logger.h
LOGGER_HED_PATH = $(SRCDIR)/logger.h
.PHONY: all debug verbose profile valgrind build clean cleanobj cleanlib cleanexe dirs
.PHONY: OPTIMIZE_FLAGS DEBUG_FLAGS VERBOSE_FLAGS PROFILE_FLAGS PROFILE_FLAGS_GP
all: OPTIMIZE_FLAGS build
debug: DEBUG_FLAGS build
verbose: VERBOSE_FLAGS OPTIMIZE_FLAGS build
profile: PROFILE_FLAGS_GP DEBUG_FLAGS OPTIMIZE_FLAGS build
valgrind: OPTIMIZE_FLAGS DEBUG_FLAGS build
build: cleanexe dirs mrsfast $(EXE)
clean: cleanobj cleanlib
$(MRSLIBDIR):
@echo Please clone the repository with --recursive option!; exit 1;
$(EDLIB_LIB_SRC_PATH):
@echo Please clone the repository with --recursive option!; exit 1;
$(EDLIB_LIB_HED_PATH):
@echo Please clone the repository with --recursive option!; exit 1;
$(LOGGER_LIB_HED_PATH):
@echo Please clone the repository with --recursive option!; exit 1;
$(EDLIB_SRC_PATH): $(EDLIB_LIB_SRC_PATH) $(EDLIB_HED_PATH)
@cp -v $(EDLIB_LIB_SRC_PATH) $(EDLIB_SRC_PATH)
$(EDLIB_HED_PATH): $(EDLIB_LIB_HED_PATH)
@cp -v $(EDLIB_LIB_HED_PATH) $(EDLIB_HED_PATH)
$(LOGGER_HED_PATH): $(LOGGER_LIB_HED_PATH)
@cp -v $(LOGGER_LIB_HED_PATH) $(LOGGER_HED_PATH)
dirs:
@mkdir -p $(OBJDIR)
$(EXE): $(LOGGER_HED_PATH) $(EDLIB_SRC_PATH) $(MYOBJ)
$(CXX) $(MYOBJ) $(MRSOBJ) -o $@ ${LDFLAGS} ${LIBS}
$(OBJDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
$(CXX) $(CXXFLAGS) $(LIBS) -c $< -o $@
mrsfast: $(MRS_SRC_FILES)
@$(MAKE) -C $(MRSDIR)
$(MRSDIR)/%: $(MRSLIBDIR)/%
@cp -v $< $@
cleanobj:
@rm -fv $(MYOBJ) $(MRSOBJ)
cleanlib:
@rm -fv $(LOGGER_HED_PATH) $(EDLIB_SRC_PATH) $(EDLIB_HED_PATH) $(MRS_SRC_FILES)
cleanexe:
@rm -fv $(EXE)
OPTIMIZE_FLAGS:
$(eval CFLAGS = $(CFLAGS) -O3)
$(eval CXXFLAGS = $(CXXFLAGS) -O3)
DEBUG_FLAGS:
$(eval CFLAGS = $(CFLAGS) -g)
$(eval CXXFLAGS = $(CXXFLAGS) -g)
VERBOSE_FLAGS:
$(eval CFLAGS = $(CFLAGS) -DDEBUG)
$(eval CXXFLAGS = $(CXXFLAGS) -DDEBUG)
PROFILE_FLAGS:
$(eval LIBS = $(LIBS) -lprofiler)
PROFILE_FLAGS_GP:
$(eval CFLAGS = $(CFLAGS) -pg)
$(eval CXXFLAGS = $(CXXFLAGS) -pg)
$(eval LIBS = $(LIBS) -pg)