1 | # Put objects into subdirs |
---|
2 | AUTOMAKE_OPTIONS = subdir-objects |
---|
3 | |
---|
4 | # Default extension to use when no bla_SOURCES exists. |
---|
5 | AM_DEFAULT_SOURCE_EXT = .cpp |
---|
6 | |
---|
7 | # Macros (like boost) are in the m4 folder |
---|
8 | ACLOCAL_AMFLAGS = -I m4 |
---|
9 | |
---|
10 | # Common flags for preprocessor and linker |
---|
11 | AM_CPPFLAGS = \ |
---|
12 | -I$(top_srcdir)/include \ |
---|
13 | -DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN \ |
---|
14 | $(BOOST_CPPFLAGS) \ |
---|
15 | $(ARB_CPPFLAGS) \ |
---|
16 | $(CODE_COVERAGE_CPPFLAGS) \ |
---|
17 | $(TBB_CPPFLAGS) \ |
---|
18 | $(TBB_MALLOC_CPPFLAGS) |
---|
19 | |
---|
20 | AM_LDFLAGS = \ |
---|
21 | $(BOOST_LDFLAGS) \ |
---|
22 | $(ARB_LDFLAGS) \ |
---|
23 | $(TBB_LDFLAGS) \ |
---|
24 | $(TBB_MALLOC_LDFLAGS) |
---|
25 | |
---|
26 | AM_CXXFLAGS = \ |
---|
27 | $(CODE_COVERAGE_CXXFLAGS) |
---|
28 | |
---|
29 | AM_CFLAGS = \ |
---|
30 | $(CODE_COVERAGE_CFLAGS) |
---|
31 | |
---|
32 | |
---|
33 | # Files to copy into distribution packages |
---|
34 | EXTRA_BINDIST = \ |
---|
35 | LICENSE \ |
---|
36 | CHANGELOG \ |
---|
37 | README \ |
---|
38 | arb_LICENSE.txt \ |
---|
39 | arb_PUBLIB_LICENSE.txt |
---|
40 | |
---|
41 | EXTRA_DIST = \ |
---|
42 | $(EXTRA_BINDIST) \ |
---|
43 | Makefile.am \ |
---|
44 | configure.ac \ |
---|
45 | autogen.sh \ |
---|
46 | tools \ |
---|
47 | test_data/ltp_reduced.arb.xz \ |
---|
48 | include \ |
---|
49 | tests |
---|
50 | |
---|
51 | CLEANFILES = \ |
---|
52 | CHANGELOG \ |
---|
53 | README |
---|
54 | |
---|
55 | ### TARGETS ### |
---|
56 | |
---|
57 | # calling pkglibdir our ARBHOME (.../lib/sina), we install |
---|
58 | # internal libs and binaries to .../bin and .../lib subdirs |
---|
59 | |
---|
60 | bin_PROGRAMS = src/sina |
---|
61 | lib_LTLIBRARIES = src/libsina.la |
---|
62 | |
---|
63 | if ENABLE_FAT_TAR |
---|
64 | arblibdir = $(libdir)/arb/lib |
---|
65 | |
---|
66 | bin_PROGRAMS += arb_pt_server arb_message |
---|
67 | arblib_DATA = \ |
---|
68 | arb_tcp.dat |
---|
69 | |
---|
70 | arb_message_SOURCES= |
---|
71 | arb_pt_server_SOURCES= |
---|
72 | endif |
---|
73 | |
---|
74 | ### TARGET CONFIGS ### |
---|
75 | |
---|
76 | src_libsina_la_SOURCES = \ |
---|
77 | src/align.cpp \ |
---|
78 | src/align.h \ |
---|
79 | src/aligned_base.cpp \ |
---|
80 | src/aligned_base.h \ |
---|
81 | src/alignment_stats.cpp \ |
---|
82 | src/alignment_stats.h \ |
---|
83 | src/buffer.h \ |
---|
84 | src/cache.h \ |
---|
85 | src/cseq.cpp \ |
---|
86 | src/cseq.h \ |
---|
87 | src/cseq_impl.h \ |
---|
88 | src/cseq_comparator.cpp \ |
---|
89 | src/cseq_comparator.h \ |
---|
90 | src/famfinder.h \ |
---|
91 | src/famfinder.cpp \ |
---|
92 | src/graph.h \ |
---|
93 | src/helpers.h \ |
---|
94 | src/idset.h \ |
---|
95 | src/mesh.h \ |
---|
96 | src/mesh_debug.h \ |
---|
97 | src/mseq.cpp \ |
---|
98 | src/mseq.h \ |
---|
99 | src/progress.h \ |
---|
100 | src/pseq.cpp \ |
---|
101 | src/pseq.h \ |
---|
102 | src/query_arb.cpp \ |
---|
103 | src/query_arb.h \ |
---|
104 | src/query_pt.cpp \ |
---|
105 | src/query_pt.h \ |
---|
106 | src/rw_fasta.cpp \ |
---|
107 | src/rw_fasta.h \ |
---|
108 | src/rw_arb.cpp \ |
---|
109 | src/rw_arb.h \ |
---|
110 | src/rw_csv.cpp \ |
---|
111 | src/rw_csv.h \ |
---|
112 | src/log.cpp \ |
---|
113 | src/log.h \ |
---|
114 | src/scoring_schemes.h \ |
---|
115 | src/search.h \ |
---|
116 | src/search.cpp \ |
---|
117 | src/search_filter.cpp \ |
---|
118 | src/search_filter.h \ |
---|
119 | src/tempfile.h \ |
---|
120 | src/timer.h \ |
---|
121 | src/tray.cpp \ |
---|
122 | src/tray.h \ |
---|
123 | src/kmer.h \ |
---|
124 | src/kmer_search.cpp \ |
---|
125 | src/kmer_search.h |
---|
126 | |
---|
127 | src_libsina_la_LDFLAGS = \ |
---|
128 | $(ARB_LDFLAGS) \ |
---|
129 | $(BOOST_LDFLAGS) |
---|
130 | |
---|
131 | src_libsina_la_LIBADD = \ |
---|
132 | $(Z_LIB) \ |
---|
133 | $(ARB_LIBS) \ |
---|
134 | $(BOOST_PROGRAM_OPTIONS_LIB) \ |
---|
135 | $(BOOST_THREAD_LIB) \ |
---|
136 | $(BOOST_IOSTREAMS_LIB) \ |
---|
137 | $(BOOST_SYSTEM_LIB) \ |
---|
138 | $(BOOST_FILESYSTEM_LIB) \ |
---|
139 | $(TBB_LIB) \ |
---|
140 | $(TBB_MALLOC_LIB) |
---|
141 | |
---|
142 | sina_libs = \ |
---|
143 | src/libsina.la \ |
---|
144 | $(ARB_PROBE_LIBS) \ |
---|
145 | $(ARB_HELIX_LIBS) \ |
---|
146 | $(ARB_LIBS) \ |
---|
147 | $(CODE_COVERAGE_LIBS) |
---|
148 | |
---|
149 | src_sina_LDADD = $(sina_libs) |
---|
150 | |
---|
151 | arb_pt_server$(EXEEXT): $(ARBHOME)/bin/arb_pt_server$(EXEEXT) |
---|
152 | cp $< $@ |
---|
153 | arb_message$(EXEEXT): $(ARBHOME)/bin/arb_message$(EXEXT) |
---|
154 | cp $< $@ |
---|
155 | arb_tcp.dat: $(ARBHOME)/lib/arb_tcp.dat |
---|
156 | cp $< $@ |
---|
157 | |
---|
158 | |
---|
159 | @CODE_COVERAGE_RULES@ |
---|
160 | CODE_COVERAGE_DIRECTORY = $(top_builddir)/src |
---|
161 | CODE_COVERAGE_OUTPUT_DIRECTORY = $(top_builddir)/coverage |
---|
162 | CODE_COVERAGE_OUTPUT_FILE = $(top_builddir)/coverage.info |
---|
163 | header_paths = $(abspath $(patsubst -I%,%,$(filter -I%,$(AM_CPPFLAGS) $(CPPFLAGS)))) |
---|
164 | CODE_COVERAGE_IGNORE_PATTERN = \ |
---|
165 | $(patsubst %,%/\*,$(header_paths) /usr) \ |
---|
166 | \*/c++/\* \ |
---|
167 | \*unit_tests\* \ |
---|
168 | \*include\* |
---|
169 | |
---|
170 | ### DOCUMENTATION ### |
---|
171 | |
---|
172 | DOC_SOURCE = \ |
---|
173 | doc/source/conf.py \ |
---|
174 | doc/source/index.rst \ |
---|
175 | doc/source/fields.rst \ |
---|
176 | doc/source/install.rst \ |
---|
177 | doc/source/commandline.rst \ |
---|
178 | doc/source/CHANGELOG.rst \ |
---|
179 | doc/source/README.rst \ |
---|
180 | README.rst |
---|
181 | |
---|
182 | doc_DATA := $(filter %.txt,$(DOC_SOURCE:doc/source/%.rst=doc/text/%.txt)) |
---|
183 | |
---|
184 | EXTRA_DIST += $(DOC_SOURCE) |
---|
185 | |
---|
186 | man1_MANS = doc/man/sina.1 |
---|
187 | |
---|
188 | |
---|
189 | $(doc_DATA): doc/build.stamp |
---|
190 | doc/build.stamp: $(DOC_SOURCE) |
---|
191 | $(SPHINX_BUILD) -M text $$(dirname $<) doc |
---|
192 | touch $@ |
---|
193 | CLEANFILES += doc/build.stamp |
---|
194 | |
---|
195 | $(man1_MANS): $(DOC_SOURCE) |
---|
196 | $(SPHINX_BUILD) -M man $$(dirname $<) doc |
---|
197 | |
---|
198 | %: doc/text/%.txt |
---|
199 | cp $< $@ |
---|
200 | |
---|
201 | |
---|
202 | |
---|
203 | CLEANFILES += sina-manual.log |
---|
204 | LATEXTOMAN=$(top_srcdir)/tools/latex2man |
---|
205 | |
---|
206 | export TEXINPUTS=$(top_srcdir):$(top_srcdir)/tools/: |
---|
207 | |
---|
208 | CLEANFILES += $(doc_DATA) $(check_DATA) $(man1_MANS) |
---|
209 | |
---|
210 | clean-local-docs: |
---|
211 | rm -rf doc/doctrees |
---|
212 | |
---|
213 | |
---|
214 | ### PACKAGE ### |
---|
215 | |
---|
216 | |
---|
217 | dist-hook: |
---|
218 | find $(distdir) \( -name \*~ -or -name \*.log -or -name \*.arb \) -delete |
---|
219 | |
---|
220 | |
---|
221 | BINDISTFILES = |
---|
222 | bindistdir = $(PACKAGE)-$(VERSION)-$(OSNAME) |
---|
223 | |
---|
224 | bindistdir: all |
---|
225 | rm -rf $(bindistdir) |
---|
226 | mkdir $(bindistdir) |
---|
227 | $(MAKE) DESTDIR=$(abspath $(bindistdir)) install |
---|
228 | mv -f $(bindistdir)/$(prefix)/* $(bindistdir) |
---|
229 | cd $(bindistdir); for f in bin/sina share/doc/sina*; do \ |
---|
230 | test -f $$f && $(LN_S) $$f; done || true |
---|
231 | for f in $(EXTRA_BINDIST); do \ |
---|
232 | cp -fpR $(top_srcdir)/$$f $(bindistdir)/$$f 2>/dev/null || \ |
---|
233 | cp -fpR $(top_builddir)/$$f $(bindistdir)/$$f; done; \ |
---|
234 | find $(bindistdir) -depth -type d -empty -exec rmdir {} \; |
---|
235 | binaries=$$(find $(bindistdir) -type f -exec file --mime {} \; | \ |
---|
236 | $(GREP) -E "application/x-.*(mach|executable|sharedlib)" | cut -d: -f1); \ |
---|
237 | export LDPATHS="$(subst -L,,$(filter -L%, $(BOOST_LDFLAGS)))"; \ |
---|
238 | for binary in $$binaries; do $(top_srcdir)/tools/fix_libpaths.sh "$$binary"; done; \ |
---|
239 | find $(bindistdir) \( -name \*.la -or -name \*.a \) -delete |
---|
240 | |
---|
241 | tar_allow_lns = $${TAR-tar} cof - "$$tardir" |
---|
242 | bindist-gzip: bindistdir |
---|
243 | tardir=$(bindistdir) && $(tar_allow_lns) | GZIP=$(GZIP_ENV) gzip -c >$(bindistdir).tar.gz |
---|
244 | rm -rf $(bindistdir) |
---|
245 | bindist-bzip2: bindistdir |
---|
246 | tardir=$(bindistdir) && $(tar_allow_lns) | BZIP2=$${BZIP2--9} bzip2 -c >$(bindistdir).tar.bz2 |
---|
247 | rm -rf $(bindistdir) |
---|
248 | |
---|
249 | |
---|
250 | .PHONY: bindistdir bindist-gzip bindist-bzip2 |
---|
251 | |
---|
252 | |
---|
253 | ### Unit Tests ### |
---|
254 | |
---|
255 | test_libs = \ |
---|
256 | $(sina_libs) \ |
---|
257 | $(BOOST_UNIT_TEST_FRAMEWORK_LIB) \ |
---|
258 | $(BOOST_SYSTEM_LIB) |
---|
259 | |
---|
260 | LOG_COMPILER = $(top_srcdir)/tools/test_driver.sh |
---|
261 | |
---|
262 | TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ |
---|
263 | $(top_srcdir)/build-aux/tap-driver.sh --comments |
---|
264 | |
---|
265 | check_PROGRAMS = \ |
---|
266 | src/unit_tests/cseq_test \ |
---|
267 | src/unit_tests/cseq_comparator_test \ |
---|
268 | src/unit_tests/idset_test \ |
---|
269 | src/unit_tests/kmer_test \ |
---|
270 | src/unit_tests/kmer_search_test \ |
---|
271 | src/unit_tests/famfinder_test \ |
---|
272 | src/unit_tests/progress_test \ |
---|
273 | src/unit_tests/rw_csv_test \ |
---|
274 | src/unit_tests/query_arb_test |
---|
275 | |
---|
276 | src_unit_tests_cseq_test_LDADD = $(test_libs) |
---|
277 | src_unit_tests_cseq_test_LDFLAGS = $(ARB_LDFLAGS) |
---|
278 | src_unit_tests_cseq_comparator_test_LDADD = $(test_libs) |
---|
279 | src_unit_tests_cseq_comparator_test_LDFLAGS = $(ARB_LDFLAGS) |
---|
280 | src_unit_tests_idset_test_LDADD = $(test_libs) |
---|
281 | src_unit_tests_idset_test_LDFLAGS = $(ARB_LDFLAGS) |
---|
282 | src_unit_tests_kmer_test_LDADD = $(test_libs) |
---|
283 | src_unit_tests_kmer_test_LDFLAGS = $(ARB_LDFLAGS) |
---|
284 | src_unit_tests_kmer_search_test_LDADD = $(test_libs) |
---|
285 | src_unit_tests_kmer_search_test_LDFLAGS = $(ARB_LDFLAGS) |
---|
286 | src_unit_tests_famfinder_test_LDADD = $(test_libs) |
---|
287 | src_unit_tests_famfinder_test_LDFLAGS = $(ARB_LDFLAGS) |
---|
288 | src_unit_tests_rw_csv_test_LDADD = $(test_libs) |
---|
289 | src_unit_tests_rw_csv_test_LDFLAGS = $(ARB_LDFLAGS) |
---|
290 | src_unit_tests_query_arb_test_LDADD = $(test_libs) |
---|
291 | src_unit_tests_query_arb_test_LDFLAGS = $(ARB_LDFLAGS) |
---|
292 | src_unit_tests_progress_test_LDADD = $(BOOST_UNIT_TEST_FRAMEWORK_LIB) |
---|
293 | |
---|
294 | test_scripts = \ |
---|
295 | tests/readwrite.test \ |
---|
296 | tests/align.test \ |
---|
297 | tests/search.test \ |
---|
298 | tests/infocommands.test \ |
---|
299 | tests/accuracy_kmer.test \ |
---|
300 | tests/accuracy.test |
---|
301 | |
---|
302 | |
---|
303 | check_DATA = test_data/ltp_reduced.arb |
---|
304 | |
---|
305 | TESTS = $(check_PROGRAMS) $(test_scripts) |
---|
306 | |
---|
307 | ## add `make check-filtered P=<pattern>` |
---|
308 | P ?= / |
---|
309 | # call contains, MATCH, WORDS - filters by substr |
---|
310 | contains = $(foreach v,$(2),$(if $(findstring $(1),$(v)),$(v),)) |
---|
311 | # call strip_term - removes leading ^ and trailing $ |
---|
312 | strip_term = $(patsubst ^%,%,$(patsubst %$$,%,$(1))) |
---|
313 | # call add_term - adds leading ^ and trailing $ |
---|
314 | add_term = $(patsubst %,^%$$,$(1)) |
---|
315 | # call contains_term MATCH WORDS - filters by substr with ^ and $ matching start/end |
---|
316 | contains_term = $(call strip_term,$(call contains,$(1),$(call add_term,$(2)))) |
---|
317 | filtered_tests = $(foreach v,$(P),$(call contains_term,$(v),$(TEST_LOGS))) |
---|
318 | check-filtered: |
---|
319 | $(MAKE) $(AM_MAKEFLAGS) check TEST_LOGS="$(filtered_tests)" |
---|
320 | .PHONY: check-filtered |
---|
321 | |
---|
322 | ## pass ARGS to tests |
---|
323 | TEST_ARGS := $(check_DATA) $(TEST_EXTRA_ARGS) |
---|
324 | export TEST_ARGS |
---|
325 | $(test_scripts): $(bin_PROGRAMS) $(check_DATA) tests/test_helper.sh |
---|
326 | |
---|
327 | ## unzip source test data into build folder |
---|
328 | test_data/%: test_data/%.xz |
---|
329 | mkdir -p $$(dirname $@) |
---|
330 | unxz -c $< > $@ |
---|
331 | |
---|
332 | clean-local: clean-local-check clean-local-docs |
---|
333 | |
---|
334 | clean-local-check: |
---|
335 | rm -f test.*.xml |
---|
336 | rm -f test_data/ltp_reduced.arb.* |
---|
337 | rm -f test_data/ltp_reduced.sidx |
---|
338 | |
---|
339 | .PHONY: clean-local-check clean-local-docs |
---|
340 | |
---|
341 | |
---|