1# Makefile for samtools, utilities for the Sequence Alignment/Map format.
2#
3#    Copyright (C) 2008-2021 Genome Research Ltd.
4#    Portions copyright (C) 2010-2012 Broad Institute.
5#
6# Permission is hereby granted, free of charge, to any person obtaining a copy
7# of this software and associated documentation files (the "Software"), to deal
8# in the Software without restriction, including without limitation the rights
9# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10# copies of the Software, and to permit persons to whom the Software is
11# furnished to do so, subject to the following conditions:
12#
13# The above copyright notice and this permission notice shall be included in
14# all copies or substantial portions of the Software.
15#
16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22# DEALINGS IN THE SOFTWARE.
23
24CC       = gcc
25AR       = ar
26AWK      = awk
27CPPFLAGS =
28#CFLAGS   = -g -Wall -O2 -pedantic -std=c99 -D_XOPEN_SOURCE=600
29CFLAGS   = -g -Wall -O2
30LDFLAGS  =
31LIBS     =
32
33LZ4DIR   = ./lz4
34LZ4_CPPFLAGS = -I$(LZ4DIR)
35LZ4_LDFLAGS  = -L$(LZ4DIR)
36
37
38AOBJS=      bam.o bam_aux.o bam_index.o bam_plcmd.o sam_view.o bam_fastq.o \
39            bam_cat.o bam_md.o bam_plbuf.o bam_reheader.o bam_sort.o \
40            bam_rmdup.o bam_rmdupse.o bam_mate.o bam_stat.o bam_color.o \
41            bamtk.o bam2bcf.o bam2bcf_indel.o sample.o \
42            cut_target.o phase.o bam2depth.o coverage.o padding.o bedcov.o bamshuf.o \
43            faidx.o dict.o stats.o stats_isize.o bam_flags.o bam_split.o \
44            bam_tview.o bam_tview_curses.o bam_tview_html.o bam_lpileup.o \
45            bam_quickcheck.o bam_addrprg.o bam_markdup.o tmp_file.o \
46            bam_ampliconclip.o amplicon_stats.o bam_import.o bam_samples.o
47LZ4OBJS  =  $(LZ4DIR)/lz4.o
48
49prefix      = /usr/local
50exec_prefix = $(prefix)
51bindir      = $(exec_prefix)/bin
52datarootdir = $(prefix)/share
53mandir      = $(datarootdir)/man
54man1dir     = $(mandir)/man1
55
56# Installation location for $(MISC_PROGRAMS) and $(MISC_SCRIPTS)
57misc_bindir = $(bindir)
58
59# Use BSD_INSTALL_PROGRAM to strip when WITH_DEBUG not set
60MKDIR_P         = mkdir -p
61INSTALL         = install -p
62INSTALL_DATA    = ${BSD_INSTALL_DATA}
63INSTALL_DIR     = $(MKDIR_P)
64INSTALL_MAN     = ${BSD_INSTALL_MAN}
65INSTALL_PROGRAM = ${BSD_INSTALL_PROGRAM}
66INSTALL_SCRIPT  = ${BSD_INSTALL_SCRIPT}
67
68PROGRAMS = samtools
69
70MISC_PROGRAMS = \
71	misc/ace2sam misc/maq2sam-long misc/maq2sam-short \
72	misc/md5fa misc/md5sum-lite misc/wgsim
73
74MISC_SCRIPTS = \
75	misc/blast2sam.pl misc/bowtie2sam.pl misc/export2sam.pl \
76	misc/fasta-sanitize.pl misc/interpolate_sam.pl misc/novo2sam.pl \
77	misc/plot-ampliconstats misc/plot-bamstats misc/psl2sam.pl \
78	misc/sam2vcf.pl misc/samtools.pl misc/seq_cache_populate.pl \
79	misc/soap2sam.pl misc/wgsim_eval.pl misc/zoom2sam.pl
80
81TEST_PROGRAMS = \
82	test/merge/test_bam_translate \
83	test/merge/test_rtrans_build \
84	test/merge/test_trans_tbl_init \
85	test/split/test_count_rg \
86	test/split/test_expand_format_string \
87	test/split/test_filter_header_rg \
88	test/split/test_parse_args \
89	test/vcf-miniview
90
91all: $(PROGRAMS) $(MISC_PROGRAMS) $(TEST_PROGRAMS)
92
93ALL_CPPFLAGS = -I. $(HTSLIB_CPPFLAGS) $(LZ4_CPPFLAGS) $(CPPFLAGS)
94ALL_LDFLAGS  = $(HTSLIB_LDFLAGS) $(LZ4_LDFLAGS) $(LDFLAGS)
95ALL_LIBS     = -lz $(LIBS)
96
97# Usually config.mk and config.h are generated by running configure
98# or config.status, but if those aren't used create defaults here.
99
100config.mk:
101	@sed -e '/^prefix/,/^LIBS/d;s/@Hsource@//;s/@Hinstall@/#/;s#@HTSDIR@#../htslib#g;s/@HTSLIB_CPPFLAGS@/-I$$(HTSDIR)/g;s/@CURSES_LIB@/-lcurses/g' config.mk.in > $@
102
103config.h:
104	echo '/* Basic config.h generated by Makefile */' > $@
105	echo '#define HAVE_CURSES' >> $@
106	echo '#define HAVE_CURSES_H' >> $@
107
108include config.mk
109
110# If not using GNU make, you need to copy the version number from version.sh
111# into here.
112PACKAGE_VERSION = $(shell ./version.sh)
113
114# Force version.h to be remade if $(PACKAGE_VERSION) has changed.
115version.h: $(if $(wildcard version.h),$(if $(findstring "$(PACKAGE_VERSION)",$(shell cat version.h)),,force))
116
117# If you don't have GNU Make but are building from a Git repository, you may
118# wish to replace this with a rule that always rebuilds version.h:
119# version.h: force
120#	echo '#define SAMTOOLS_VERSION "`git describe --always --dirty`"' > $@
121version.h:
122	echo '#define SAMTOOLS_VERSION "$(PACKAGE_VERSION)"' > $@
123	echo '#define SAMTOOLS_CC "$(CC)"' >> $@
124	echo '#define SAMTOOLS_CPPFLAGS "$(CPPFLAGS)"' >> $@
125	echo '#define SAMTOOLS_CFLAGS "$(CFLAGS)"' >> $@
126	echo '#define SAMTOOLS_LDFLAGS "$(LDFLAGS)"' >> $@
127	echo '#define SAMTOOLS_HTSDIR "$(HTSDIR)"' >> $@
128	echo '#define SAMTOOLS_LIBS "$(LIBS)"' >> $@
129	echo '#define SAMTOOLS_CURSES_LIB "$(CURSES_LIB)"' >> $@
130
131print-version:
132	@echo $(PACKAGE_VERSION)
133
134
135.SUFFIXES: .c .o
136
137.c.o:
138	$(CC) $(CFLAGS) $(ALL_CPPFLAGS) -c -o $@ $<
139
140LIBST_OBJS = sam_opts.o sam_utils.o bedidx.o
141
142
143samtools: $(AOBJS) $(LZ4OBJS) libst.a $(HTSLIB)
144	$(CC) $(ALL_LDFLAGS) -o $@ $(AOBJS) $(LZ4OBJS) libst.a $(HTSLIB_LIB) $(CURSES_LIB) -lm $(ALL_LIBS) -lpthread
145
146# For building samtools and its test suite only: NOT to be installed.
147libst.a: $(LIBST_OBJS)
148	@-rm -f $@
149	$(AR) -rcs $@ $(LIBST_OBJS)
150
151
152bam_h = bam.h $(htslib_sam_h)
153bam2bcf_h = bam2bcf.h $(htslib_hts_h) $(htslib_vcf_h)
154bam_lpileup_h = bam_lpileup.h $(htslib_sam_h)
155bam_plbuf_h = bam_plbuf.h $(htslib_sam_h)
156bam_tview_h = bam_tview.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_faidx_h) $(bam2bcf_h) $(htslib_khash_h) $(bam_lpileup_h)
157bedidx_h = bedidx.h $(htslib_hts_h)
158sam_opts_h = sam_opts.h $(htslib_hts_h)
159sample_h = sample.h $(htslib_kstring_h)
160samtools_h = samtools.h $(htslib_hts_defs_h) $(htslib_sam_h)
161stats_isize_h = stats_isize.h $(htslib_khash_h)
162tmp_file_h = tmp_file.h $(htslib_sam_h) $(LZ4DIR)/lz4.h
163
164bam.o: bam.c config.h $(bam_h) $(htslib_kstring_h)
165bam2bcf.o: bam2bcf.c config.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_kstring_h) $(htslib_kfunc_h) $(bam2bcf_h)
166bam2bcf_indel.o: bam2bcf_indel.c config.h $(htslib_hts_h) $(htslib_sam_h) $(bam2bcf_h) $(htslib_khash_h) $(htslib_ksort_h)
167bam2depth.o: bam2depth.c config.h $(htslib_sam_h) $(samtools_h) $(bedidx_h) $(sam_opts_h) $(htslib_khash_h)
168coverage.o: coverage.c config.h $(htslib_sam_h) $(htslib_hts_h) $(samtools_h) $(sam_opts_h)
169bam_addrprg.o: bam_addrprg.c config.h $(htslib_sam_h) $(htslib_kstring_h) $(samtools_h) $(htslib_thread_pool_h) $(sam_opts_h)
170bam_aux.o: bam_aux.c config.h $(htslib_sam_h)
171bam_cat.o: bam_cat.c config.h $(htslib_bgzf_h) $(htslib_sam_h) $(htslib_cram_h) $(htslib_kstring_h) $(samtools_h) $(sam_opts_h)
172bam_color.o: bam_color.c config.h $(htslib_sam_h)
173bam_fastq.o: bam_fastq.c config.h $(htslib_sam_h) $(htslib_klist_h) $(htslib_kstring_h) $(htslib_bgzf_h) $(htslib_thread_pool_h) $(samtools_h) $(sam_opts_h)
174bam_import.o: bam_import.c config.h $(htslib_sam_h) $(htslib_thread_pool_h) $(samtools_h) $(sam_opts_h)
175bam_index.o: bam_index.c config.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_khash_h) $(samtools_h) $(sam_opts_h)
176bam_lpileup.o: bam_lpileup.c config.h $(bam_plbuf_h) $(bam_lpileup_h) $(htslib_ksort_h)
177bam_mate.o: bam_mate.c config.h $(htslib_thread_pool_h) $(sam_opts_h) $(htslib_kstring_h) $(htslib_sam_h) $(samtools_h)
178bam_md.o: bam_md.c config.h $(htslib_faidx_h) $(htslib_sam_h) $(htslib_kstring_h) $(htslib_thread_pool_h) $(sam_opts_h) $(samtools_h)
179bam_plbuf.o: bam_plbuf.c config.h $(htslib_hts_h) $(htslib_sam_h) $(bam_plbuf_h)
180bam_plcmd.o: bam_plcmd.c config.h $(htslib_sam_h) $(htslib_faidx_h) $(htslib_kstring_h) $(htslib_klist_h) $(htslib_khash_str2int_h) $(samtools_h) $(bedidx_h) $(sam_opts_h) $(bam2bcf_h) $(sample_h) $(htslib_cram_h)
181bam_quickcheck.o: bam_quickcheck.c config.h $(htslib_hts_h) $(htslib_sam_h)
182bam_reheader.o: bam_reheader.c config.h $(htslib_bgzf_h) $(htslib_sam_h) $(htslib_hfile_h) $(htslib_cram_h) $(samtools_h)
183bam_rmdup.o: bam_rmdup.c config.h $(htslib_sam_h) $(sam_opts_h) $(samtools_h) $(bam_h) $(htslib_khash_h)
184bam_rmdupse.o: bam_rmdupse.c config.h $(bam_h) $(htslib_sam_h) $(htslib_khash_h) $(htslib_klist_h) $(samtools_h)
185bam_sort.o: bam_sort.c config.h $(htslib_ksort_h) $(htslib_hts_os_h) $(htslib_khash_h) $(htslib_klist_h) $(htslib_kstring_h) $(htslib_sam_h) $(htslib_hts_endian_h) $(sam_opts_h) $(samtools_h) $(bedidx_h) $(htslib_cram_h)
186bam_split.o: bam_split.c config.h $(htslib_sam_h) $(htslib_khash_h) $(htslib_kstring_h) $(htslib_cram_h) $(htslib_thread_pool_h) $(sam_opts_h) $(samtools_h)
187bam_stat.o: bam_stat.c config.h $(htslib_sam_h) $(samtools_h) $(sam_opts_h)
188bam_tview.o: bam_tview.c config.h $(bam_tview_h) $(htslib_faidx_h) $(htslib_sam_h) $(htslib_bgzf_h) $(samtools_h) $(sam_opts_h)
189bam_tview_curses.o: bam_tview_curses.c config.h $(bam_tview_h)
190bam_tview_html.o: bam_tview_html.c config.h $(bam_tview_h)
191bam_flags.o: bam_flags.c config.h $(htslib_sam_h) $(samtools_h)
192bamshuf.o: bamshuf.c config.h $(htslib_sam_h) $(htslib_hts_h) $(htslib_ksort_h) $(samtools_h) $(htslib_thread_pool_h) $(sam_opts_h) $(htslib_khash_h)
193bamtk.o: bamtk.c config.h $(htslib_hts_h) $(htslib_hfile_h) $(samtools_h) version.h
194bedcov.o: bedcov.c config.h $(htslib_kstring_h) $(htslib_sam_h) $(htslib_thread_pool_h) $(samtools_h) $(sam_opts_h) $(htslib_kseq_h)
195bedidx.o: bedidx.c config.h $(bedidx_h) $(htslib_ksort_h) $(htslib_kseq_h) $(htslib_khash_h)
196cut_target.o: cut_target.c config.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_faidx_h) $(samtools_h) $(sam_opts_h)
197dict.o: dict.c config.h $(htslib_kseq_h) $(htslib_hts_h)
198faidx.o: faidx.c config.h $(htslib_faidx_h) $(htslib_hts_h) $(htslib_hfile_h) $(htslib_kstring_h) $(samtools_h)
199padding.o: padding.c config.h $(htslib_kstring_h) $(htslib_sam_h) $(htslib_faidx_h) $(sam_opts_h) $(samtools_h)
200phase.o: phase.c config.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_kstring_h) $(sam_opts_h) $(samtools_h) $(htslib_hts_os_h) $(htslib_kseq_h) $(htslib_khash_h) $(htslib_ksort_h)
201sam_opts.o: sam_opts.c config.h $(sam_opts_h)
202sam_utils.o: sam_utils.c config.h $(samtools_h)
203sam_view.o: sam_view.c config.h $(htslib_sam_h) $(htslib_faidx_h) $(htslib_khash_h) $(htslib_thread_pool_h) $(htslib_hts_expr_h) $(samtools_h) $(sam_opts_h) $(bam_h) $(bedidx_h)
204sample.o: sample.c config.h $(sample_h) $(htslib_khash_h)
205stats_isize.o: stats_isize.c config.h $(stats_isize_h) $(htslib_khash_h)
206stats.o: stats.c config.h $(htslib_faidx_h) $(htslib_sam_h) $(htslib_hts_h) $(htslib_hts_defs_h) $(samtools_h) $(htslib_khash_h) $(htslib_kstring_h) $(stats_isize_h) $(sam_opts_h) $(bedidx_h)
207amplicon_stats.o: amplicon_stats.c config.h $(htslib_sam_h) $(htslib_khash_h) $(samtools_h) $(sam_opts_h) bam_ampliconclip.h
208bam_markdup.o: bam_markdup.c config.h $(htslib_thread_pool_h) $(htslib_sam_h) $(sam_opts_h) $(samtools_h) $(htslib_khash_h) $(htslib_klist_h) $(htslib_kstring_h) $(tmp_file_h)
209tmp_file.o: tmp_file.c config.h $(tmp_file_h) $(htslib_sam_h)
210bam_ampliconclip.o: bam_ampliconclip.c config.h $(htslib_thread_pool_h) $(sam_opts_h) $(htslib_hts_h) $(htslib_hfile_h) $(htslib_kstring_h) $(htslib_sam_h) $(samtools_h) bam_ampliconclip.h
211bam_samples.o: bam_samples.c config.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_faidx_h) $(htslib_khash_h) $(htslib_kseq_h) $(samtools_h)
212
213# Maintainer source code checks
214# - copyright boilerplate presence
215# - tab and trailing space detection
216maintainer-check:
217	test/maintainer/check_copyright.pl .
218	test/maintainer/check_spaces.pl .
219
220# test programs
221
222# For tests that might use it, set $REF_PATH explicitly to use only reference
223# areas within the test suite (or set it to ':' to use no reference areas).
224# (regression.sh sets $REF_PATH to a subdirectory itself.)
225#
226# If using MSYS, avoid poor shell expansion via:
227#    MSYS2_ARG_CONV_EXCL="*" make check
228check test: samtools $(BGZIP) $(TEST_PROGRAMS)
229	test/split/test_count_rg
230	test/split/test_expand_format_string
231	test/split/test_filter_header_rg
232	test/split/test_parse_args
233	REF_PATH=: test/test.pl --exec bgzip=$(BGZIP) $${TEST_OPTS:-}
234	test/merge/test_bam_translate test/merge/test_bam_translate.tmp
235	test/merge/test_rtrans_build
236	test/merge/test_trans_tbl_init
237	cd test/mpileup && AWK="$(AWK)" ./regression.sh mpileup.reg
238	cd test/mpileup && AWK="$(AWK)" ./regression.sh depth.reg
239
240
241test/merge/test_bam_translate: test/merge/test_bam_translate.o test/test.o libst.a $(HTSLIB)
242	$(CC) $(ALL_LDFLAGS) -o $@ test/merge/test_bam_translate.o test/test.o libst.a $(HTSLIB_LIB) $(ALL_LIBS) -lpthread
243
244test/merge/test_rtrans_build: test/merge/test_rtrans_build.o test/test.o libst.a $(HTSLIB)
245	$(CC) $(ALL_LDFLAGS) -o $@ test/merge/test_rtrans_build.o test/test.o libst.a $(HTSLIB_LIB) $(ALL_LIBS) -lpthread
246
247test/merge/test_trans_tbl_init: test/merge/test_trans_tbl_init.o test/test.o libst.a $(HTSLIB)
248	$(CC) $(ALL_LDFLAGS) -o $@ test/merge/test_trans_tbl_init.o test/test.o libst.a $(HTSLIB_LIB) $(ALL_LIBS) -lpthread
249
250test/split/test_count_rg: test/split/test_count_rg.o test/test.o libst.a $(HTSLIB)
251	$(CC) $(ALL_LDFLAGS) -o $@ test/split/test_count_rg.o test/test.o libst.a $(HTSLIB_LIB) $(ALL_LIBS) -lpthread
252
253test/split/test_expand_format_string: test/split/test_expand_format_string.o test/test.o libst.a $(HTSLIB)
254	$(CC) $(ALL_LDFLAGS) -o $@ test/split/test_expand_format_string.o test/test.o libst.a $(HTSLIB_LIB) $(ALL_LIBS) -lpthread
255
256test/split/test_filter_header_rg: test/split/test_filter_header_rg.o test/test.o libst.a $(HTSLIB)
257	$(CC) $(ALL_LDFLAGS) -o $@ test/split/test_filter_header_rg.o test/test.o libst.a $(HTSLIB_LIB) $(ALL_LIBS) -lpthread
258
259test/split/test_parse_args: test/split/test_parse_args.o test/test.o libst.a $(HTSLIB)
260	$(CC) $(ALL_LDFLAGS) -o $@ test/split/test_parse_args.o test/test.o libst.a $(HTSLIB_LIB) $(ALL_LIBS) -lpthread
261
262test/vcf-miniview: test/vcf-miniview.o $(HTSLIB)
263	$(CC) $(ALL_LDFLAGS) -o $@ test/vcf-miniview.o $(HTSLIB_LIB) $(ALL_LIBS) -lpthread
264
265test_test_h = test/test.h $(htslib_sam_h)
266
267test/merge/test_bam_translate.o: test/merge/test_bam_translate.c config.h bam_sort.o $(test_test_h)
268test/merge/test_rtrans_build.o: test/merge/test_rtrans_build.c config.h bam_sort.o
269test/merge/test_trans_tbl_init.o: test/merge/test_trans_tbl_init.c config.h bam_sort.o
270test/split/test_count_rg.o: test/split/test_count_rg.c config.h bam_split.o $(test_test_h)
271test/split/test_expand_format_string.o: test/split/test_expand_format_string.c config.h bam_split.o $(test_test_h)
272test/split/test_filter_header_rg.o: test/split/test_filter_header_rg.c config.h $(test_test_h) $(samtools_h) $(htslib_kstring_h)
273test/split/test_parse_args.o: test/split/test_parse_args.c config.h bam_split.o $(test_test_h)
274test/test.o: test/test.c config.h $(htslib_sam_h) $(test_test_h)
275test/vcf-miniview.o: test/vcf-miniview.c config.h $(htslib_vcf_h)
276
277# test HTSlib as well, where it is built alongside SAMtools
278
279check-all test-all: test-htslib test
280
281# misc programs
282
283misc/ace2sam: misc/ace2sam.o $(HTSLIB)
284	$(CC) $(ALL_LDFLAGS) -o $@ misc/ace2sam.o $(HTSLIB_LIB) $(ALL_LIBS)
285
286misc/maq2sam-short: misc/maq2sam-short.o
287	$(CC) $(LDFLAGS) -o $@ misc/maq2sam-short.o $(ALL_LIBS)
288
289misc/maq2sam-long: misc/maq2sam-long.o
290	$(CC) $(LDFLAGS) -o $@ misc/maq2sam-long.o $(ALL_LIBS)
291
292misc/md5fa: misc/md5fa.o $(HTSLIB)
293	$(CC) $(ALL_LDFLAGS) -o $@ misc/md5fa.o $(HTSLIB_LIB) $(ALL_LIBS)
294
295misc/md5sum-lite: misc/md5sum-lite.o $(HTSLIB)
296	$(CC) $(ALL_LDFLAGS) -o $@ misc/md5sum-lite.o $(HTSLIB_LIB) $(ALL_LIBS)
297
298misc/wgsim: misc/wgsim.o $(HTSLIB)
299	$(CC) $(ALL_LDFLAGS) -o $@ misc/wgsim.o -lm $(HTSLIB_LIB) $(ALL_LIBS)
300
301misc/ace2sam.o: misc/ace2sam.c config.h $(htslib_kstring_h) $(htslib_kseq_h)
302misc/md5fa.o: misc/md5fa.c config.h $(htslib_kseq_h) $(htslib_hts_h)
303misc/md5sum-lite.o: misc/md5sum-lite.c config.h $(htslib_hts_h)
304misc/wgsim.o: misc/wgsim.c config.h version.h $(htslib_kseq_h) $(htslib_hts_os_h)
305
306misc/maq2sam-short.o: misc/maq2sam.c config.h version.h
307	$(CC) $(CFLAGS) $(ALL_CPPFLAGS) -c -o $@ misc/maq2sam.c
308
309misc/maq2sam-long.o: misc/maq2sam.c config.h version.h
310	$(CC) $(CFLAGS) -DMAQ_LONGREADS $(ALL_CPPFLAGS) -c -o $@ misc/maq2sam.c
311
312
313install: $(PROGRAMS) $(MISC_PROGRAMS)
314	$(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(misc_bindir) $(DESTDIR)$(man1dir)
315	$(INSTALL_PROGRAM) $(PROGRAMS) $(DESTDIR)$(bindir)
316	$(INSTALL_PROGRAM) $(MISC_PROGRAMS) $(DESTDIR)$(misc_bindir)
317	$(INSTALL_SCRIPT) $(MISC_SCRIPTS) $(DESTDIR)$(misc_bindir)
318	$(INSTALL_MAN) doc/samtools*.1 misc/wgsim.1 $(DESTDIR)$(man1dir)
319
320
321testclean:
322	-rm -f test/*.new test/*.tmp test/*/*.new test/*/*.tmp test/*/*.tmp.*
323	-cd test/dat && rm -f test_input_*.bam.bai
324	-cd test/mpileup && rm -f FAIL-*.out* PASS-*.out* anomalous.[bc]*am indels.[bc]*am mpileup.*.[cs]*am mpileup.*.crai overlap50.[bc]*am expected/1.out xx#depth*.bam*
325
326mostlyclean: testclean
327	-rm -f *.o misc/*.o test/*.o test/*/*.o version.h $(LZ4OBJS)
328
329clean: mostlyclean
330	-rm -f $(PROGRAMS) libst.a $(MISC_PROGRAMS) $(TEST_PROGRAMS)
331
332distclean: clean
333	-rm -f config.cache config.h config.log config.mk config.status
334	-rm -f TAGS
335	-rm -rf autom4te.cache
336
337clean-all: clean clean-htslib
338
339distclean-all: distclean distclean-htslib
340
341mostlyclean-all: mostlyclean mostlyclean-htslib
342
343testclean-all: testclean testclean-htslib
344
345tags:
346	ctags -f TAGS *.[ch] misc/*.[ch]
347
348
349force:
350
351
352.PHONY: all check check-all clean clean-all distclean distclean-all force
353.PHONY: install mostlyclean mostlyclean-all print-version tags
354.PHONY: test test-all testclean testclean-all
355