-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile.am
341 lines (272 loc) · 8.57 KB
/
Makefile.am
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# Put objects into subdirs
AUTOMAKE_OPTIONS = subdir-objects
# Default extension to use when no bla_SOURCES exists.
AM_DEFAULT_SOURCE_EXT = .cpp
# Macros (like boost) are in the m4 folder
ACLOCAL_AMFLAGS = -I m4
# Common flags for preprocessor and linker
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN \
$(BOOST_CPPFLAGS) \
$(ARB_CPPFLAGS) \
$(CODE_COVERAGE_CPPFLAGS) \
$(TBB_CPPFLAGS) \
$(TBB_MALLOC_CPPFLAGS)
AM_LDFLAGS = \
$(BOOST_LDFLAGS) \
$(ARB_LDFLAGS) \
$(TBB_LDFLAGS) \
$(TBB_MALLOC_LDFLAGS)
AM_CXXFLAGS = \
$(CODE_COVERAGE_CXXFLAGS)
AM_CFLAGS = \
$(CODE_COVERAGE_CFLAGS)
# Files to copy into distribution packages
EXTRA_BINDIST = \
LICENSE \
CHANGELOG \
README \
arb_LICENSE.txt \
arb_PUBLIB_LICENSE.txt
EXTRA_DIST = \
$(EXTRA_BINDIST) \
Makefile.am \
configure.ac \
autogen.sh \
tools \
test_data/ltp_reduced.arb.xz \
include \
tests
CLEANFILES = \
CHANGELOG \
README
### TARGETS ###
# calling pkglibdir our ARBHOME (.../lib/sina), we install
# internal libs and binaries to .../bin and .../lib subdirs
bin_PROGRAMS = src/sina
lib_LTLIBRARIES = src/libsina.la
if ENABLE_FAT_TAR
arblibdir = $(libdir)/arb/lib
bin_PROGRAMS += arb_pt_server arb_message
arblib_DATA = \
arb_tcp.dat
arb_message_SOURCES=
arb_pt_server_SOURCES=
endif
### TARGET CONFIGS ###
src_libsina_la_SOURCES = \
src/align.cpp \
src/align.h \
src/aligned_base.cpp \
src/aligned_base.h \
src/alignment_stats.cpp \
src/alignment_stats.h \
src/buffer.h \
src/cache.h \
src/cseq.cpp \
src/cseq.h \
src/cseq_impl.h \
src/cseq_comparator.cpp \
src/cseq_comparator.h \
src/famfinder.h \
src/famfinder.cpp \
src/graph.h \
src/helpers.h \
src/idset.h \
src/mesh.h \
src/mesh_debug.h \
src/mseq.cpp \
src/mseq.h \
src/progress.h \
src/pseq.cpp \
src/pseq.h \
src/query_arb.cpp \
src/query_arb.h \
src/query_pt.cpp \
src/query_pt.h \
src/rw_fasta.cpp \
src/rw_fasta.h \
src/rw_arb.cpp \
src/rw_arb.h \
src/rw_csv.cpp \
src/rw_csv.h \
src/log.cpp \
src/log.h \
src/scoring_schemes.h \
src/search.h \
src/search.cpp \
src/search_filter.cpp \
src/search_filter.h \
src/tempfile.h \
src/timer.h \
src/tray.cpp \
src/tray.h \
src/kmer.h \
src/kmer_search.cpp \
src/kmer_search.h
src_libsina_la_LDFLAGS = \
$(ARB_LDFLAGS) \
$(BOOST_LDFLAGS)
src_libsina_la_LIBADD = \
$(Z_LIB) \
$(ARB_LIBS) \
$(BOOST_PROGRAM_OPTIONS_LIB) \
$(BOOST_THREAD_LIB) \
$(BOOST_IOSTREAMS_LIB) \
$(BOOST_SYSTEM_LIB) \
$(BOOST_FILESYSTEM_LIB) \
$(TBB_LIB) \
$(TBB_MALLOC_LIB)
sina_libs = \
src/libsina.la \
$(ARB_PROBE_LIBS) \
$(ARB_HELIX_LIBS) \
$(ARB_LIBS) \
$(CODE_COVERAGE_LIBS)
src_sina_LDADD = $(sina_libs)
arb_pt_server$(EXEEXT): $(ARBHOME)/bin/arb_pt_server$(EXEEXT)
cp $< $@
arb_message$(EXEEXT): $(ARBHOME)/bin/arb_message$(EXEXT)
cp $< $@
arb_tcp.dat: $(ARBHOME)/lib/arb_tcp.dat
cp $< $@
@CODE_COVERAGE_RULES@
CODE_COVERAGE_DIRECTORY = $(top_builddir)/src
CODE_COVERAGE_OUTPUT_DIRECTORY = $(top_builddir)/coverage
CODE_COVERAGE_OUTPUT_FILE = $(top_builddir)/coverage.info
header_paths = $(abspath $(patsubst -I%,%,$(filter -I%,$(AM_CPPFLAGS) $(CPPFLAGS))))
CODE_COVERAGE_IGNORE_PATTERN = \
$(patsubst %,%/\*,$(header_paths) /usr) \
\*/c++/\* \
\*unit_tests\* \
\*include\*
### DOCUMENTATION ###
DOC_SOURCE = \
doc/source/conf.py \
doc/source/index.rst \
doc/source/fields.rst \
doc/source/install.rst \
doc/source/commandline.rst \
doc/source/CHANGELOG.rst \
doc/source/README.rst \
README.rst
doc_DATA := $(filter %.txt,$(DOC_SOURCE:doc/source/%.rst=doc/text/%.txt))
EXTRA_DIST += $(DOC_SOURCE)
man1_MANS = doc/man/sina.1
$(doc_DATA): doc/build.stamp
doc/build.stamp: $(DOC_SOURCE)
$(SPHINX_BUILD) -M text $$(dirname $<) doc
touch $@
CLEANFILES += doc/build.stamp
$(man1_MANS): $(DOC_SOURCE)
$(SPHINX_BUILD) -M man $$(dirname $<) doc
%: doc/text/%.txt
cp $< $@
CLEANFILES += sina-manual.log
LATEXTOMAN=$(top_srcdir)/tools/latex2man
export TEXINPUTS=$(top_srcdir):$(top_srcdir)/tools/:
CLEANFILES += $(doc_DATA) $(check_DATA) $(man1_MANS)
clean-local-docs:
rm -rf doc/doctrees
### PACKAGE ###
dist-hook:
find $(distdir) \( -name \*~ -or -name \*.log -or -name \*.arb \) -delete
BINDISTFILES =
bindistdir = $(PACKAGE)-$(VERSION)-$(OSNAME)
bindistdir: all
rm -rf $(bindistdir)
mkdir $(bindistdir)
$(MAKE) DESTDIR=$(abspath $(bindistdir)) install
mv -f $(bindistdir)/$(prefix)/* $(bindistdir)
cd $(bindistdir); for f in bin/sina share/doc/sina*; do \
test -f $$f && $(LN_S) $$f; done || true
for f in $(EXTRA_BINDIST); do \
cp -fpR $(top_srcdir)/$$f $(bindistdir)/$$f 2>/dev/null || \
cp -fpR $(top_builddir)/$$f $(bindistdir)/$$f; done; \
find $(bindistdir) -depth -type d -empty -exec rmdir {} \;
binaries=$$(find $(bindistdir) -type f -exec file --mime {} \; | \
$(GREP) -E "application/x-.*(mach|executable|sharedlib)" | cut -d: -f1); \
export LDPATHS="$(subst -L,,$(filter -L%, $(BOOST_LDFLAGS)))"; \
for binary in $$binaries; do $(top_srcdir)/tools/fix_libpaths.sh "$$binary"; done; \
find $(bindistdir) \( -name \*.la -or -name \*.a \) -delete
tar_allow_lns = $${TAR-tar} cof - "$$tardir"
bindist-gzip: bindistdir
tardir=$(bindistdir) && $(tar_allow_lns) | GZIP=$(GZIP_ENV) gzip -c >$(bindistdir).tar.gz
rm -rf $(bindistdir)
bindist-bzip2: bindistdir
tardir=$(bindistdir) && $(tar_allow_lns) | BZIP2=$${BZIP2--9} bzip2 -c >$(bindistdir).tar.bz2
rm -rf $(bindistdir)
.PHONY: bindistdir bindist-gzip bindist-bzip2
### Unit Tests ###
test_libs = \
$(sina_libs) \
$(BOOST_UNIT_TEST_FRAMEWORK_LIB) \
$(BOOST_SYSTEM_LIB)
LOG_COMPILER = $(top_srcdir)/tools/test_driver.sh
TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/build-aux/tap-driver.sh --comments
check_PROGRAMS = \
src/unit_tests/cseq_test \
src/unit_tests/cseq_comparator_test \
src/unit_tests/idset_test \
src/unit_tests/kmer_test \
src/unit_tests/kmer_search_test \
src/unit_tests/famfinder_test \
src/unit_tests/progress_test \
src/unit_tests/rw_csv_test \
src/unit_tests/query_arb_test
src_unit_tests_cseq_test_LDADD = $(test_libs)
src_unit_tests_cseq_test_LDFLAGS = $(ARB_LDFLAGS)
src_unit_tests_cseq_comparator_test_LDADD = $(test_libs)
src_unit_tests_cseq_comparator_test_LDFLAGS = $(ARB_LDFLAGS)
src_unit_tests_idset_test_LDADD = $(test_libs)
src_unit_tests_idset_test_LDFLAGS = $(ARB_LDFLAGS)
src_unit_tests_kmer_test_LDADD = $(test_libs)
src_unit_tests_kmer_test_LDFLAGS = $(ARB_LDFLAGS)
src_unit_tests_kmer_search_test_LDADD = $(test_libs)
src_unit_tests_kmer_search_test_LDFLAGS = $(ARB_LDFLAGS)
src_unit_tests_famfinder_test_LDADD = $(test_libs)
src_unit_tests_famfinder_test_LDFLAGS = $(ARB_LDFLAGS)
src_unit_tests_rw_csv_test_LDADD = $(test_libs)
src_unit_tests_rw_csv_test_LDFLAGS = $(ARB_LDFLAGS)
src_unit_tests_query_arb_test_LDADD = $(test_libs)
src_unit_tests_query_arb_test_LDFLAGS = $(ARB_LDFLAGS)
src_unit_tests_progress_test_LDADD = $(BOOST_UNIT_TEST_FRAMEWORK_LIB)
test_scripts = \
tests/readwrite.test \
tests/align.test \
tests/search.test \
tests/infocommands.test \
tests/accuracy_kmer.test \
tests/accuracy.test
check_DATA = test_data/ltp_reduced.arb
TESTS = $(check_PROGRAMS) $(test_scripts)
## add `make check-filtered P=<pattern>`
P ?= /
# call contains, MATCH, WORDS - filters by substr
contains = $(foreach v,$(2),$(if $(findstring $(1),$(v)),$(v),))
# call strip_term - removes leading ^ and trailing $
strip_term = $(patsubst ^%,%,$(patsubst %$$,%,$(1)))
# call add_term - adds leading ^ and trailing $
add_term = $(patsubst %,^%$$,$(1))
# call contains_term MATCH WORDS - filters by substr with ^ and $ matching start/end
contains_term = $(call strip_term,$(call contains,$(1),$(call add_term,$(2))))
filtered_tests = $(foreach v,$(P),$(call contains_term,$(v),$(TEST_LOGS)))
check-filtered:
$(MAKE) $(AM_MAKEFLAGS) check TEST_LOGS="$(filtered_tests)"
.PHONY: check-filtered
## pass ARGS to tests
TEST_ARGS := $(check_DATA) $(TEST_EXTRA_ARGS)
export TEST_ARGS
$(test_scripts): $(bin_PROGRAMS) $(check_DATA) tests/test_helper.sh
## unzip source test data into build folder
test_data/%: test_data/%.xz
mkdir -p $$(dirname $@)
unxz -c $< > $@
clean-local: clean-local-check clean-local-docs
clean-local-check:
rm -f test.*.xml
rm -f test_data/ltp_reduced.arb.*
rm -f test_data/ltp_reduced.sidx
.PHONY: clean-local-check clean-local-docs