1SUBDIRS = htslib
2HTSLIB = htslib/libhts.a
3
4AM_CPPFLAGS = $(OPENMP_CFLAGS) -I$(top_srcdir)/htslib
5AM_LDFLAGS = $(OPENMP_CFLAGS)
6LDADD = $(HTSLIB) libcore.a
7
8noinst_LIBRARIES = libcore.a libclean.a libpop.a
9bin_PROGRAMS = ustacks cstacks sstacks process_radtags process_shortreads \
10	kmer_filter clone_filter populations phasedstacks \
11	tsv2bam gstacks
12
13libcore_a_SOURCES = \
14	src/aln_utils.h src/aln_utils.cc \
15	src/BamI.h src/BamI.cc \
16	src/BamUnalignedI.h \
17	src/BowtieI.h \
18	src/BustardI.h \
19	src/catalog_utils.h src/catalog_utils.cc \
20	src/cmb.h src/cmb.cc \
21	src/constants.h src/constants.cc \
22	src/DNANSeq.h src/DNANSeq.cc \
23	src/DNASeq4.h src/DNASeq4.cc \
24	src/DNASeq.h src/DNASeq.cc \
25	src/FastaI.h \
26	src/FastqI.h \
27	src/GappedAln.h \
28	src/gzFasta.h src/gzFasta.cc \
29	src/gzFastq.h \
30	src/input.h src/input.cc \
31	src/kmers.h src/kmers.cc \
32	src/locus.h src/locus.cc \
33	src/locus_readers.h \
34	src/log_utils.h src/log_utils.cc \
35	src/MetaPopInfo.h src/MetaPopInfo.cc \
36	src/models.h src/models.cc \
37	src/mstack.h src/mstack.cc \
38	src/mst.h src/mst.cc \
39	src/nucleotides.h src/nucleotides.cc \
40	src/renz.h src/renz.cc \
41	src/SamI.h \
42	src/Seq.h src/Seq.cc \
43	src/sql_utilities.h src/sql_utilities.cc \
44	src/stacks.h src/stacks.cc \
45	src/Tsv.h \
46	src/utils.h src/utils.cc \
47	src/Vcf.h src/Vcf.cc \
48	$(HTSLIB)
49
50libclean_a_SOURCES = \
51	src/clean.h src/clean.cc \
52	src/file_io.h src/file_io.cc \
53	src/write.h src/write.cc
54
55libpop_a_SOURCES = \
56	src/bootstrap.h \
57	src/export_formats.h src/export_formats.cc \
58	src/genotype_dictionaries.h src/genotype_dictionaries.cc \
59	src/ordered.h \
60	src/PopMap.h \
61	src/PopSum.h src/PopSum.cc \
62	src/smoothing.h \
63	src/smoothing_utils.h \
64	src/Hwp.h src/Hwp.cc
65
66phasedstacks_SOURCES = libcore.a src/phasedstacks.h src/phasedstacks.cc
67
68process_radtags_SOURCES    = libcore.a libclean.a src/process_radtags.h src/process_radtags.cc
69process_shortreads_SOURCES = libcore.a libclean.a src/process_shortreads.h src/process_shortreads.cc
70kmer_filter_SOURCES        = libcore.a libclean.a src/kmer_filter.h src/kmer_filter.cc
71clone_filter_SOURCES       = libcore.a libclean.a src/clone_filter.h src/clone_filter.cc
72
73ustacks_SOURCES = libcore.a src/ustacks.h src/ustacks.cc
74cstacks_SOURCES = libcore.a src/cstacks.h src/cstacks.cc
75sstacks_SOURCES = libcore.a src/sstacks.h src/sstacks.cc
76tsv2bam_SOURCES = libcore.a src/tsv2bam.cc
77gstacks_SOURCES = libcore.a src/gstacks.h src/gstacks.cc src/debruijn.h src/debruijn.cc src/Alignment.h src/SuffixTree.h src/SuffixTree.cc
78populations_SOURCES = libcore.a libpop.a src/populations.h src/populations.cc
79
80process_radtags_LDADD    = $(LDADD) libclean.a
81process_shortreads_LDADD = $(LDADD) libclean.a
82clone_filter_LDADD       = $(LDADD) libclean.a
83kmer_filter_LDADD        = $(LDADD) libclean.a
84populations_LDADD        = $(LDADD) libpop.a
85
86dist_bin_SCRIPTS = scripts/denovo_map.pl scripts/ref_map.pl \
87	scripts/integrate_alignments.py scripts/count_fixed_catalog_snps.py \
88	scripts/stacks-integrate-alignments scripts/stacks-dist-extract scripts/stacks-gdb # scripts/denovo_map.py
89
90dist_noinst_SCRIPTS = autogen.sh scripts/extract_interpop_chars.pl scripts/convert_stacks.pl
91
92LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(abs_top_srcdir)/tests/tap-driver.sh
93
94TESTS = tests/process_radtags.t tests/kmer_filter.t tests/ustacks.t tests/pstacks.t
95
96EXTRA_DIST = LICENSE INSTALL README ChangeLog $(TESTS)
97
98pkglocalstatedir = $(localstatedir)/$(PACKAGE)
99
100debug:
101	$(MAKE) all "CXXFLAGS=-g -Wall -DDEBUG -O0"
102
103install-data-hook:
104	sed -e 's,_VERSION_,$(VERSION),' -e 's,_BINDIR_,$(bindir)/,g' -e 's,_PKGDATADIR_,$(pkgdatadir)/,g' $(DESTDIR)$(bindir)/denovo_map.pl > $(DESTDIR)$(bindir)/denovo_map.pl.subst
105	mv $(DESTDIR)$(bindir)/denovo_map.pl.subst $(DESTDIR)$(bindir)/denovo_map.pl
106	chmod +x $(DESTDIR)$(bindir)/denovo_map.pl
107	sed -e 's,_VERSION_,$(VERSION),' -e 's,_BINDIR_,$(bindir)/,g' -e 's,_PKGDATADIR_,$(pkgdatadir)/,g' $(DESTDIR)$(bindir)/ref_map.pl > $(DESTDIR)$(bindir)/ref_map.pl.subst
108	mv $(DESTDIR)$(bindir)/ref_map.pl.subst $(DESTDIR)$(bindir)/ref_map.pl
109	chmod +x $(DESTDIR)$(bindir)/ref_map.pl
110	sed -i.bkp -e 's,_VERSION_,$(VERSION),' $(DESTDIR)$(bindir)/stacks-integrate-alignments
111	rm -f $(DESTDIR)$(bindir)/stacks-integrate-alignments.bkp
112	chmod +x $(DESTDIR)$(bindir)/stacks-integrate-alignments
113	chmod +x $(DESTDIR)$(bindir)/stacks-dist-extract
114	chmod +x $(DESTDIR)$(bindir)/stacks-gdb
115	##sed -e 's,_VERSION_,$(VERSION),' -e 's,_BINDIR_,$(DESTDIR)$(bindir)/,g' -e 's,_PKGDATADIR_,$(pkgdatadir)/,g' $(DESTDIR)$(bindir)/denovo_map.py > $(DESTDIR)$(bindir)/denovo_map.py.subst
116	##mv $(DESTDIR)$(bindir)/denovo_map.py.subst $(DESTDIR)$(bindir)/denovo_map.py
117	##chmod +x $(DESTDIR)$(bindir)/denovo_map.py
118
119uninstall-hook:
120	rm -rf $(DESTDIR)$(pkglocalstatedir)
121