-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakeRules
268 lines (221 loc) · 8.3 KB
/
MakeRules
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
ifndef CODE_DIR
$(error no CODE_DIR)
endif
OS := $(shell uname -s )
GCC_VER := $(shell gcc --version | head -1 | cut -f 3 -d ' ' )
#$(info GCC version: $(GCC_VER) )
# https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/
WarningCPPFLAGS =
ifdef AT_NCBI
WarningCPPFLAGS = -Wextra -Wpedantic
# C
WarningCPPFLAGS += \
-Waddress \
-Warray-bounds=2 \
-Warray-parameter=2 \
-Wbool-operation \
-Wcast-align \
-Wcast-align=strict \
-Wchar-subscripts \
-Wcomment \
-Wdeprecated-declarations \
-Wduplicated-branches \
-Wduplicated-cond \
-Wenum-compare \
-Wformat=2 \
-Wformat-overflow=2 \
-Wformat-security \
-Wformat-signedness \
-Wformat-truncation=2 \
-Wfree-nonheap-object \
-Wint-in-bool-context \
-Winit-self \
-Wlogical-not-parentheses \
-Wmemset-transposed-args \
-Wmismatched-dealloc \
-Wmissing-braces \
-Wmissing-declarations \
-Wmissing-field-initializers \
-Wmissing-format-attribute \
-Wmissing-include-dirs \
-Wmultistatement-macros \
-Wnarrowing \
-Wno-builtin-declaration-mismatch \
-Wno-builtin-macro-redefined \
-Wnonnull \
-Wnull-dereference \
-Wparentheses \
-Wpointer-arith \
-Wredundant-decls \
-Wreturn-type \
-Wsequence-point \
-Wswitch \
-Wshadow \
-Wshadow=local \
-Wsign-compare \
-Wsign-conversion \
-Wsizeof-array-div \
-Wsizeof-pointer-div \
-Wsizeof-pointer-memaccess \
-Wstringop-overflow=0 \
-Wstrict-aliasing \
-Wstrict-overflow=1 \
-Wswitch \
-Wtautological-compare \
-Wtrigraphs \
-Wuninitialized \
-Wunused \
-Wunknown-pragmas \
-Wunused-function \
-Wunused-label \
-Wunused-macros \
-Wunused-value \
-Wunused-variable \
-Wvolatile-register-var
# -Wstringop-overflow=1: works incorrectly with array's
# C++
WarningCPPFLAGS += \
-Waligned-new \
-Wcatch-value=3 \
-Wclass-memaccess \
-Wcomma-subscript \
-Wctad-maybe-unsupported \
-Wctor-dtor-privacy \
-Wdelete-non-virtual-dtor \
-Wextra-semi \
-Winvalid-imported-macros \
-Wmismatched-new-delete \
-Wmismatched-tags \
-Wno-deprecated-enum-enum-conversion \
-Wno-deprecated-enum-float-conversion \
-Wno-invalid-offsetof \
-Wno-pessimizing-move \
-Woverloaded-virtual \
-Wrange-loop-construct \
-Wredundant-tags \
-Wreorder \
-Wsign-promo \
-Wstrict-null-sentinel \
-Wsuggest-override \
-Wuseless-cast \
-Wzero-as-null-pointer-constant
ifeq ($(GCC_VER), 13.2.0)
#$(info $(GCC_VER) warnings )
# C
WarningCPPFLAGS += \
-Wdangling-pointer=2 \
-Winfinite-recursion \
-Wno-error=aggressive-loop-optimizations \
-Wtrivial-auto-var-init \
-Wuse-after-free=3
# C++
WarningCPPFLAGS += \
-Winvalid-constexpr \
-Wno-self-move
endif
ifeq ($(OS), Linux)
# Do not work on Darwin -> 13.0.2 ??
WarningCPPFLAGS += \
-Wbool-compare \
-Wc++11-compat \
-Wc++14-compat \
-Wc++17-compat \
-Wc++20-compat \
-Wconversion \
-Wlogical-op \
-Wmaybe-uninitialized \
-Wmemset-elt-size \
-Wnonnull-compare
endif
endif
SimpleCPPFLAGS = -std=gnu++17 -pthread -malign-double -fno-math-errno -fchar8_t -fdiagnostics-color=always $(WarningCPPFLAGS)
# -ffloat-store # slows down two-fold
# -ffinite-math-only # NAN problem
# -fanalyze # Too slow and strange messages
OptCPPFLAGS = $(SimpleCPPFLAGS) -O3
DebugCPPFLAGS = $(SimpleCPPFLAGS) -g
CXX=g++
COMPILE.cpp= $(CXX) $(CPPFLAGS) -c
LIBS=-pthread
ifdef AT_NCBI
ECHO = @echo ""; echo ""
else
ECHO = @echo ""
endif
CPP_DIR = $(CODE_DIR)/cpp
COMMON_RAW_HPP = $(CPP_DIR)/common.hpp $(CPP_DIR)/common.inc
COMMON_HPP = $(COMMON_RAW_HPP) $(CPP_DIR)/version.inc
COMMON = $(CPP_DIR)/common
$(CPP_DIR)/common.o: $(COMMON_RAW_HPP)
$(CPP_DIR)/graph.o: $(CPP_DIR)/graph.hpp $(COMMON_RAW_HPP)
$(CPP_DIR)/combinatorics.o: $(CPP_DIR)/combinatorics.hpp $(COMMON_RAW_HPP)
$(CPP_DIR)/ncurses.o: $(CPP_DIR)/ncurses.hpp $(COMMON_RAW_HPP)
$(CPP_DIR)/curl_easy.o: $(CPP_DIR)/curl_easy.hpp $(COMMON_RAW_HPP)
TSV_DIR=$(CPP_DIR)/tsv
$(TSV_DIR)/tsv.o: $(TSV_DIR)/tsv.hpp $(COMMON_RAW_HPP)
XML_DIR=$(CPP_DIR)/xml
$(XML_DIR)/xml.o: $(XML_DIR)/xml.hpp $(COMMON_RAW_HPP) $(TSV_DIR)/tsv.hpp
XML_OBJ = $(XML_DIR)/xml.o $(TSV_DIR)/tsv.o
DM_DIR = $(CPP_DIR)/dm
NUMERIC_HPP = $(DM_DIR)/numeric.hpp $(COMMON_HPP)
$(DM_DIR)/numeric.o: $(NUMERIC_HPP)
NUMERIC_OBJ = $(DM_DIR)/numeric.o $(CPP_DIR)/common.o
NUMERIC = $(DM_DIR)/numeric $(COMMON)
$(DM_DIR)/matrix.o: $(DM_DIR)/matrix.hpp $(NUMERIC_HPP)
$(DM_DIR)/optim.o: $(DM_DIR)/optim.hpp $(DM_DIR)/matrix.hpp $(NUMERIC_HPP)
MATRIX = $(DM_DIR)/matrix $(NUMERIC)
DM_HPP = $(NUMERIC_HPP) $(DM_DIR)/matrix.hpp $(DM_DIR)/dataset.hpp
$(DM_DIR)/dataset.o: $(DM_HPP) $(TSV_DIR)/tsv.hpp $(DM_DIR)/optim.hpp
DM_OBJ = $(NUMERIC_OBJ) $(DM_DIR)/matrix.o $(DM_DIR)/optim.o $(DM_DIR)/dataset.o
DM = $(NUMERIC) $(DM_DIR)/matrix $(DM_DIR)/optim $(DM_DIR)/dataset
PREDICT_HPP = $(DM_DIR)/prediction.hpp $(DM_HPP)
$(DM_DIR)/prediction.o: $(PREDICT_HPP)
PREDICT_OBJ = $(DM_DIR)/prediction.o $(DM_OBJ)
PREDICT = $(DM_DIR)/prediction $(DM)
PHYL_DIR = $(CPP_DIR)/phylogeny
DISTTREE_HPP = $(PHYL_DIR)/distTree.hpp $(PREDICT_HPP) $(CPP_DIR)/graph.hpp
$(PHYL_DIR)/distTree.o: $(DISTTREE_HPP)
DISTTREE_OBJ = $(PHYL_DIR)/distTree.o $(PREDICT_OBJ) $(CPP_DIR)/graph.o
DISTTREE = $(PHYL_DIR)/distTree $(PREDICT) $(CPP_DIR)/graph
$(PHYL_DIR)/featureTree.o: $(PHYL_DIR)/featureTree.hpp $(DM_HPP) $(CPP_DIR)/graph.hpp
FEATURE_TREE_OBJ = $(PHYL_DIR)/featureTree.o $(DM_OBJ) $(CPP_DIR)/graph.o
FEATURE_TREE = $(PHYL_DIR)/featureTree $(DM) $(CPP_DIR)/graph
GEN_DIR = $(CPP_DIR)/genetics
$(GEN_DIR)/genbank_text.o: $(GEN_DIR)/genbank_text.hpp $(COMMON_RAW_HPP)
$(GEN_DIR)/seq.o: $(GEN_DIR)/seq.hpp $(COMMON_RAW_HPP)
SEQ_OBJ = $(GEN_DIR)/seq.o $(CPP_DIR)/common.o
$(GEN_DIR)/hmm.o: $(GEN_DIR)/hmm.hpp $(GEN_DIR)/seq.hpp $(DM_DIR)/matrix.hpp $(DM_DIR)/numeric.hpp $(COMMON_RAW_HPP)
HMM_OBJ = $(GEN_DIR)/hmm.o $(GEN_DIR)/seq.o $(DM_DIR)/matrix.o $(NUMERIC_OBJ)
$(GEN_DIR)/gff.o: $(GEN_DIR)/gff.hpp $(COMMON_RAW_HPP)
DISSIM_DIR = $(CPP_DIR)/dissim
$(DISSIM_DIR)/evolution.o: $(DISSIM_DIR)/evolution.hpp $(NUMERIC_HPP)
EVOLUTION_OBJ = $(NUMERIC_OBJ) $(DM_DIR)/optim.o $(DM_DIR)/matrix.o $(DISSIM_DIR)/evolution.o
NW_DIR = $(DISSIM_DIR)/nw
$(NW_DIR)/nw_aligner.o: $(NW_DIR)/nw_aligner.hpp
$(NW_DIR)/nw_band_aligner.o: $(NW_DIR)/nw_band_aligner.hpp
$(NW_DIR)/raw_scoremat.o:
cc -malign-double -fno-math-errno -fdiagnostics-color=always -O3 -c -o $(NW_DIR)/raw_scoremat.o $(NW_DIR)/raw_scoremat.c
$(DISSIM_DIR)/align.o: $(DISSIM_DIR)/align.hpp $(GEN_DIR)/seq.hpp $(DM_DIR)/numeric.hpp $(NW_DIR)/nw_aligner.hpp $(NW_DIR)/nw_band_aligner.hpp $(DISSIM_DIR)/evolution.hpp $(COMMON_RAW_HPP)
ALIGN_OBJ = $(DISSIM_DIR)/align.o $(SEQ_OBJ) $(DM_DIR)/numeric.o $(NW_DIR)/nw_aligner.o $(NW_DIR)/nw_band_aligner.o $(NW_DIR)/raw_scoremat.o $(DISSIM_DIR)/evolution.o $(DM_DIR)/optim.o $(DM_DIR)/matrix.o
WEB_DIR=$(CPP_DIR)/web
$(WEB_DIR)/cgi.o: $(WEB_DIR)/cgi.hpp $(COMMON_HPP)
WEB_OBJ = $(WEB_DIR)/cgi.o $(CPP_DIR)/common.o
WEB = $(WEB_DIR)/cgi $(COMMON)
ifdef AT_NCBI
AMRFINDER_DIR=$(CODE_DIR)/amrfinder
$(AMRFINDER_DIR)/alignment.o: $(AMRFINDER_DIR)/alignment.hpp $(COMMON_RAW_HPP)
STXTYPER_DIR=$(CODE_DIR)/stxtyper
DATABASE_DIR = $(CODE_DIR)/database
COMMON = $(CPP_DIR)/common $(DATABASE_DIR)/application
$(DATABASE_DIR)/application.o: $(DATABASE_DIR)/application.hpp $(COMMON_RAW_HPP)
$(DATABASE_DIR)/db.o: $(DATABASE_DIR)/db.hpp $(COMMON_RAW_HPP)
$(DATABASE_DIR)/pig.o: $(DATABASE_DIR)/pig.hpp $(COMMON_RAW_HPP) $(DATABASE_DIR)/db.hpp
$(DATABASE_DIR)/genbank.o: $(DATABASE_DIR)/genbank.hpp $(COMMON_RAW_HPP) $(DATABASE_DIR)/db.hpp $(GEN_DIR)/seq.hpp
GENBANK = $(DATABASE_DIR)/genbank $(GEN_DIR)/seq
GenBank_LIB = xncbi xobjutil taxon1 $(OBJMGR_LIBS) ncbi_xloader_asn_cache asn_cache bdb $(SDBAPI_LIB) xconnect xutil ncbi_xdbapi_ctlib$(STATIC) xid_utils$(STATIC) xxconnect
# $(SRAREAD_LIBS) $(XFORMAT_LIBS)
# ncbi_xloader_sra xid_wgs ncbi_id2proc_wgs
GenBank_LIBS = $(DL_LIBS) -lz $(BERKELEYDB_LIBS) -lxutil $(SDBAPI_LIBS) $(SYBASE_LIBS) $(PSG_CLIENT_LIBS)
PHYLOGENY_DIR = $(CODE_DIR)/phylogeny
$(PHYLOGENY_DIR)/dbPhyl.o: $(PHYLOGENY_DIR)/dbPhyl.hpp $(DATABASE_DIR)/db.hpp $(COMMON_RAW_HPP)
endif