Debian Codegraph @

src/utils/htslib/Makefile

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 # Makefile for htslib, a C library for high-throughput sequencing data formats.
2 #
3 # Copyright (C) 2013-2017 Genome Research Ltd.
4 #
5 # Author: John Marshall <[email protected]>
6 #
7 # Permission is hereby granted, free of charge, to any person obtaining a copy
8 # of this software and associated documentation files (the "Software"), to deal
9 # in the Software without restriction, including without limitation the rights
10 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 # copies of the Software, and to permit persons to whom the Software is
12 # furnished to do so, subject to the following conditions:
13 #
14 # The above copyright notice and this permission notice shall be included in
15 # all copies or substantial portions of the Software.
16 #
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 # DEALINGS IN THE SOFTWARE.
24
•25 CC ?= gcc
26 AR ?= ar
27 RANLIB ?= ranlib
28
29 # Default libraries to link if configure is not used
30 htslib_default_libs = -lz -lm -lbz2 -llzma
31
32 # TODO: probably update cram code to make it compile cleanly with -Wc++-compat
33 # For testing strict C99 support add -std=c99 -D_XOPEN_SOURCE=600
34 #CFLAGS = -g -Wall -O2 -pedantic -std=c99 -D_XOPEN_SOURCE=600 -D__FUNCTION__=__func__
•35 CFLAGS ?= -g -Wall -O2
36 EXTRA_CFLAGS_PIC = -fpic
37 LIBS = $(htslib_default_libs)
38
39 prefix = /usr/local
40 exec_prefix = $(prefix)
41 bindir = $(exec_prefix)/bin
42 includedir = $(prefix)/include
43 libdir = $(exec_prefix)/lib
44 libexecdir = $(exec_prefix)/libexec
45 datarootdir = $(prefix)/share
46 mandir = $(datarootdir)/man
47 man1dir = $(mandir)/man1
48 man5dir = $(mandir)/man5
49 pkgconfigdir= $(libdir)/pkgconfig
50
51 MKDIR_P = mkdir -p
•52 INSTALL ?= install -p
53 INSTALL_DATA = $(INSTALL) -m 644
54 INSTALL_DIR = $(MKDIR_P) -m 755
55 INSTALL_LIB = $(INSTALL_DATA)
56 INSTALL_MAN = $(INSTALL_DATA)
57 INSTALL_PROGRAM = $(INSTALL)
58
59 # Set by config.mk if plugins are enabled
60 plugindir =
61
62 BUILT_PROGRAMS = \
63 bgzip \
64 htsfile \
65 tabix
66
67 BUILT_TEST_PROGRAMS =
68
69 BUILT_THRASH_PROGRAMS =
70
71 all: lib-static lib-shared $(BUILT_PROGRAMS) plugins
72
73 HTSPREFIX =
74 include htslib_vars.mk
75
76 # If not using GNU make, you need to copy the version number from version.sh
77 # into here.
78 PACKAGE_VERSION := $(shell ./version.sh)
79 LIBHTS_SOVERSION = 2
80
81 # $(NUMERIC_VERSION) is for items that must have a numeric X.Y.Z string
82 # even if this is a dirty or untagged Git working tree.
83 NUMERIC_VERSION := $(shell ./version.sh numeric)
84
85 # Force version.h to be remade if $(PACKAGE_VERSION) has changed.
86 version.h: $(if $(wildcard version.h),$(if $(findstring "$(PACKAGE_VERSION)",$(shell cat version.h)),,force))
87
88 version.h:
89 echo '#define HTS_VERSION "$(PACKAGE_VERSION)"' > $@
90
91 print-version:
92 @echo $(PACKAGE_VERSION)
93
94 show-version:
95 @echo PACKAGE_VERSION = $(PACKAGE_VERSION)
96 @echo NUMERIC_VERSION = $(NUMERIC_VERSION)
97
98 .SUFFIXES: .bundle .c .cygdll .dll .o .pico .so
99
100 .c.o:
101 $(CC) $(CFLAGS) -I. $(CPPFLAGS) -c -o $@ $<
102
103 .c.pico:
104 $(CC) $(CFLAGS) -I. $(CPPFLAGS) $(EXTRA_CFLAGS_PIC) -c -o $@ $<
105
106
107 LIBHTS_OBJS = \
108 kfunc.o \
109 knetfile.o \
110 kstring.o \
111 bcf_sr_sort.o \
112 bgzf.o \
113 errmod.o \
114 faidx.o \
115 hfile.o \
116 hfile_net.o \
117 hts.o \
118 hts_os.o\
119 md5.o \
120 multipart.o \
121 probaln.o \
122 realn.o \
123 regidx.o \
124 sam.o \
125 synced_bcf_reader.o \
126 vcf_sweep.o \
127 tbx.o \
128 textutils.o \
129 thread_pool.o \
130 vcf.o \
131 vcfutils.o \
132 cram/cram_codecs.o \
133 cram/cram_decode.o \
134 cram/cram_encode.o \
135 cram/cram_external.o \
136 cram/cram_index.o \
137 cram/cram_io.o \
138 cram/cram_samtools.o \
139 cram/cram_stats.o \
140 cram/files.o \
141 cram/mFILE.o \
142 cram/open_trace_file.o \
143 cram/pooled_alloc.o \
144 cram/rANS_static.o \
145 cram/sam_header.o \
146 cram/string_alloc.o
147
148 PLUGIN_EXT =
149 PLUGIN_OBJS =
150
151 cram_h = cram/cram.h $(cram_samtools_h) $(cram_sam_header_h) $(cram_structs_h) $(cram_io_h) cram/cram_encode.h cram/cram_decode.h cram/cram_stats.h cram/cram_codecs.h cram/cram_index.h $(htslib_cram_h)
152 cram_io_h = cram/cram_io.h $(cram_misc_h)
153 cram_misc_h = cram/misc.h $(cram_os_h)
154 cram_os_h = cram/os.h $(htslib_hts_endian_h)
155 cram_sam_header_h = cram/sam_header.h cram/string_alloc.h cram/pooled_alloc.h $(htslib_khash_h) $(htslib_kstring_h)
156 cram_samtools_h = cram/cram_samtools.h $(htslib_sam_h) $(cram_sam_header_h)
157 cram_structs_h = cram/cram_structs.h $(htslib_thread_pool_h) cram/string_alloc.h cram/mFILE.h $(htslib_khash_h)
158 cram_open_trace_file_h = cram/open_trace_file.h cram/mFILE.h
159 bcf_sr_sort_h = bcf_sr_sort.h $(htslib_synced_bcf_reader_h) $(htslib_kbitset_h)
160 hfile_internal_h = hfile_internal.h $(htslib_hfile_h) $(textutils_internal_h)
161 hts_internal_h = hts_internal.h $(htslib_hts_h) $(textutils_internal_h)
162 textutils_internal_h = textutils_internal.h $(htslib_kstring_h)
163 thread_pool_internal_h = thread_pool_internal.h $(htslib_thread_pool_h)
164
165
166 # To be effective, config.mk needs to appear after most Makefile variables are
167 # set but before most rules appear, so that it can both use previously-set
168 # variables in its own rules' prerequisites and also update variables for use
169 # in later rules' prerequisites.
170
171 # If your make doesn't accept -include, change this to 'include' if you are
172 # using the configure script or just comment the line out if you are not.
173 -include config.mk
174
175 # Usually config.h is generated by running configure or config.status,
176 # but if those aren't used create a default config.h here.
177 config.h:
178 echo '/* Default config.h generated by Makefile */' > $@
179 echo '#define HAVE_LIBBZ2 1' >> $@
180 echo '#define HAVE_LIBLZMA 1' >> $@
181 echo '#ifndef __APPLE__' >> $@
182 echo '#define HAVE_LZMA_H 1' >> $@
183 echo '#endif' >> $@
184 echo '#define HAVE_FSEEKO 1' >> $@
185 echo '#define HAVE_DRAND48 1' >> $@
186
187 # And similarly for htslib.pc.tmp ("pkg-config template"). No dependency
188 # on htslib.pc.in listed, as if that file is newer the usual way to regenerate
189 # this target is via configure or config.status rather than this rule.
190 htslib.pc.tmp:
191 sed -e '/^static_libs=/s/@static_LIBS@/$(htslib_default_libs)/;s#@[^-][^@]*@##g' htslib.pc.in > $@
192
193 # Create a makefile fragment listing the libraries and LDFLAGS needed for
194 # static linking. This can be included by projects that want to build
195 # and link against the htslib source tree instead of an installed library.
196 htslib_static.mk: htslib.pc.tmp
197 sed -n '/^static_libs=/s/[^=]*=/HTSLIB_static_LIBS = /p;/^static_ldflags=/s/[^=]*=/HTSLIB_static_LDFLAGS = /p' $< > $@
198
199
200 lib-static: libhts.a
201
202 # $(shell), :=, and ifeq/.../endif are GNU Make-specific. If you don't have
203 # GNU Make, comment out the parts of these conditionals that don't apply.
204 ifneq "$(origin PLATFORM)" "file"
205 PLATFORM := $(shell uname -s)
206 endif
207 ifeq "$(PLATFORM)" "Darwin"
208 SHLIB_FLAVOUR = dylib
209 lib-shared: libhts.dylib
210 else ifeq "$(findstring CYGWIN,$(PLATFORM))" "CYGWIN"
211 SHLIB_FLAVOUR = cygdll
212 lib-shared: cyghts-$(LIBHTS_SOVERSION).dll
213 else ifeq "$(findstring MSYS,$(PLATFORM))" "MSYS"
214 SHLIB_FLAVOUR = dll
215 lib-shared: hts-$(LIBHTS_SOVERSION).dll
216 else
217 SHLIB_FLAVOUR = so
218 lib-shared: libhts.so
219 endif
220
221 BUILT_PLUGINS = $(PLUGIN_OBJS:.o=$(PLUGIN_EXT))
222
223 plugins: $(BUILT_PLUGINS)
224
225
226 libhts.a: $(LIBHTS_OBJS)
227 @-rm -f $@
228 $(AR) -rc $@ $(LIBHTS_OBJS)
229 -$(RANLIB) $@
230
231 print-config:
232 @echo LDFLAGS = $(LDFLAGS)
233 @echo LIBHTS_OBJS = $(LIBHTS_OBJS)
234 @echo LIBS = $(LIBS)
235 @echo PLATFORM = $(PLATFORM)
236
237 # The target here is libhts.so, as that is the built file that other rules
238 # depend upon and that is used when -lhts appears in other program's recipes.
239 # As a byproduct invisible to make, libhts.so.NN is also created, as it is the
240 # file used at runtime (when $LD_LIBRARY_PATH includes the build directory).
241
242 libhts.so: $(LIBHTS_OBJS:.o=.pico)
243 $(CC) -shared -Wl,-soname,libhts.so.$(LIBHTS_SOVERSION) $(LDFLAGS) -o $@ $(LIBHTS_OBJS:.o=.pico) $(LIBS) -lpthread
244 ln -sf $@ libhts.so.$(LIBHTS_SOVERSION)
245
246 # Similarly this also creates libhts.NN.dylib as a byproduct, so that programs
247 # when run can find this uninstalled shared library (when $DYLD_LIBRARY_PATH
248 # includes this project's build directory).
249
250 libhts.dylib: $(LIBHTS_OBJS)
251 $(CC) -dynamiclib -install_name $(libdir)/libhts.$(LIBHTS_SOVERSION).dylib -current_version $(NUMERIC_VERSION) -compatibility_version $(LIBHTS_SOVERSION) $(LDFLAGS) -o $@ $(LIBHTS_OBJS) $(LIBS)
252 ln -sf $@ libhts.$(LIBHTS_SOVERSION).dylib
253
254 cyghts-$(LIBHTS_SOVERSION).dll: $(LIBHTS_OBJS)
255 $(CC) -shared -Wl,--out-implib=libhts.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import $(LDFLAGS) -o $@ -Wl,--whole-archive $(LIBHTS_OBJS) -Wl,--no-whole-archive $(LIBS) -lpthread
256
257 hts-$(LIBHTS_SOVERSION).dll: $(LIBHTS_OBJS)
258 $(CC) -shared -Wl,--out-implib=hts.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import $(LDFLAGS) -o $@ -Wl,--whole-archive $(LIBHTS_OBJS) -Wl,--no-whole-archive $(LIBS) -lpthread
259
260
261 .pico.so:
262 $(CC) -shared -Wl,-E $(LDFLAGS) -o $@ $< $(LIBS) -lpthread
263
264 .o.bundle:
265 $(CC) -bundle -Wl,-undefined,dynamic_lookup $(LDFLAGS) -o $@ $< $(LIBS)
266
267 .o.cygdll:
268 $(CC) -shared $(LDFLAGS) -o $@ $< libhts.dll.a $(LIBS)
269
270 .o.dll:
271 $(CC) -shared $(LDFLAGS) -o $@ $< hts.dll.a $(LIBS)
272
273
274 bgzf.o bgzf.pico: bgzf.c config.h $(htslib_hts_h) $(htslib_bgzf_h) $(htslib_hfile_h) $(htslib_thread_pool_h) $(htslib_hts_endian_h) cram/pooled_alloc.h $(htslib_khash_h)
275 errmod.o errmod.pico: errmod.c config.h $(htslib_hts_h) $(htslib_ksort_h) $(htslib_hts_os_h)
276 kstring.o kstring.pico: kstring.c config.h $(htslib_kstring_h)
277 knetfile.o knetfile.pico: knetfile.c config.h $(htslib_hts_log_h) $(htslib_knetfile_h)
278 hfile.o hfile.pico: hfile.c config.h $(htslib_hfile_h) $(hfile_internal_h) $(hts_internal_h) $(htslib_khash_h)
279 hfile_gcs.o hfile_gcs.pico: hfile_gcs.c config.h $(htslib_hts_h) $(htslib_kstring_h) $(hfile_internal_h)
280 hfile_libcurl.o hfile_libcurl.pico: hfile_libcurl.c config.h $(hfile_internal_h) $(htslib_hts_h) $(htslib_kstring_h) $(htslib_khash_h)
281 hfile_net.o hfile_net.pico: hfile_net.c config.h $(hfile_internal_h) $(htslib_knetfile_h)
282 hfile_s3.o hfile_s3.pico: hfile_s3.c config.h $(hfile_internal_h) $(htslib_hts_h) $(htslib_kstring_h)
283 hts.o hts.pico: hts.c config.h $(htslib_hts_h) $(htslib_bgzf_h) $(cram_h) $(htslib_hfile_h) $(htslib_hts_endian_h) version.h $(hts_internal_h) $(hfile_internal_h) $(htslib_hts_os_h) $(htslib_khash_h) $(htslib_kseq_h) $(htslib_ksort_h)
284 hts_os.o hts_os.pico: hts_os.c config.h os/rand.c
285 vcf.o vcf.pico: vcf.c config.h $(htslib_vcf_h) $(htslib_bgzf_h) $(htslib_tbx_h) $(htslib_hfile_h) $(hts_internal_h) $(htslib_khash_str2int_h) $(htslib_kstring_h) $(htslib_khash_h) $(htslib_kseq_h) $(htslib_hts_endian_h)
286 sam.o sam.pico: sam.c config.h $(htslib_sam_h) $(htslib_bgzf_h) $(cram_h) $(hts_internal_h) $(htslib_hfile_h) $(htslib_khash_h) $(htslib_kseq_h) $(htslib_kstring_h) $(htslib_hts_endian_h)
287 tbx.o tbx.pico: tbx.c config.h $(htslib_tbx_h) $(htslib_bgzf_h) $(htslib_hts_endian_h) $(hts_internal_h) $(htslib_khash_h)
288 faidx.o faidx.pico: faidx.c config.h $(htslib_bgzf_h) $(htslib_faidx_h) $(htslib_hfile_h) $(htslib_khash_h) $(htslib_kstring_h) $(hts_internal_h)
289 bcf_sr_sort.o bcf_sr_sort.pico: bcf_sr_sort.c config.h $(bcf_sr_sort_h) $(htslib_khash_str2int_h)
290 synced_bcf_reader.o synced_bcf_reader.pico: synced_bcf_reader.c config.h $(htslib_synced_bcf_reader_h) $(htslib_kseq_h) $(htslib_khash_str2int_h) $(htslib_bgzf_h) $(htslib_thread_pool_h) $(bcf_sr_sort_h)
291 vcf_sweep.o vcf_sweep.pico: vcf_sweep.c config.h $(htslib_vcf_sweep_h) $(htslib_bgzf_h)
292 vcfutils.o vcfutils.pico: vcfutils.c config.h $(htslib_vcfutils_h) $(htslib_kbitset_h)
293 kfunc.o kfunc.pico: kfunc.c config.h $(htslib_kfunc_h)
294 regidx.o regidx.pico: regidx.c config.h $(htslib_hts_h) $(htslib_kstring_h) $(htslib_kseq_h) $(htslib_khash_str2int_h) $(htslib_regidx_h) $(hts_internal_h)
295 md5.o md5.pico: md5.c config.h $(htslib_hts_h) $(htslib_hts_endian_h)
296 multipart.o multipart.pico: multipart.c config.h $(htslib_kstring_h) $(hts_internal_h) $(hfile_internal_h)
297 plugin.o plugin.pico: plugin.c config.h $(hts_internal_h) $(htslib_kstring_h)
298 probaln.o probaln.pico: probaln.c config.h $(htslib_hts_h)
299 realn.o realn.pico: realn.c config.h $(htslib_hts_h) $(htslib_sam_h)
300 textutils.o textutils.pico: textutils.c config.h $(htslib_hfile_h) $(htslib_kstring_h) $(hts_internal_h)
301
302 cram/cram_codecs.o cram/cram_codecs.pico: cram/cram_codecs.c config.h $(cram_h)
303 cram/cram_decode.o cram/cram_decode.pico: cram/cram_decode.c config.h $(cram_h) $(cram_os_h) $(htslib_hts_h)
304 cram/cram_encode.o cram/cram_encode.pico: cram/cram_encode.c config.h $(cram_h) $(cram_os_h) $(htslib_hts_h) $(htslib_hts_endian_h)
305 cram/cram_external.o cram/cram_external.pico: cram/cram_external.c config.h $(htslib_hfile_h) $(cram_h)
306 cram/cram_index.o cram/cram_index.pico: cram/cram_index.c config.h $(htslib_bgzf_h) $(htslib_hfile_h) $(hts_internal_h) $(cram_h) $(cram_os_h)
307 cram/cram_io.o cram/cram_io.pico: cram/cram_io.c config.h os/lzma_stub.h $(cram_h) $(cram_os_h) $(htslib_hts_h) $(cram_open_trace_file_h) cram/rANS_static.h $(htslib_hfile_h) $(htslib_bgzf_h) $(htslib_faidx_h) $(hts_internal_h)
308 cram/cram_samtools.o cram/cram_samtools.pico: cram/cram_samtools.c config.h $(cram_h) $(htslib_sam_h)
309 cram/cram_stats.o cram/cram_stats.pico: cram/cram_stats.c config.h $(cram_h) $(cram_os_h)
310 cram/files.o cram/files.pico: cram/files.c config.h $(cram_misc_h)
311 cram/mFILE.o cram/mFILE.pico: cram/mFILE.c config.h $(htslib_hts_log_h) $(cram_os_h) cram/mFILE.h
312 cram/open_trace_file.o cram/open_trace_file.pico: cram/open_trace_file.c config.h $(cram_os_h) $(cram_open_trace_file_h) $(cram_misc_h) $(htslib_hfile_h) $(htslib_hts_log_h)
313 cram/pooled_alloc.o cram/pooled_alloc.pico: cram/pooled_alloc.c config.h cram/pooled_alloc.h $(cram_misc_h)
314 cram/rANS_static.o cram/rANS_static.pico: cram/rANS_static.c config.h cram/rANS_static.h cram/rANS_byte.h
315 cram/sam_header.o cram/sam_header.pico: cram/sam_header.c config.h $(htslib_hts_log_h) $(cram_sam_header_h) cram/string_alloc.h
316 cram/string_alloc.o cram/string_alloc.pico: cram/string_alloc.c config.h cram/string_alloc.h
317 thread_pool.o thread_pool.pico: thread_pool.c config.h $(thread_pool_internal_h)
318
319
320 bgzip: bgzip.o libhts.a
321 $(CC) $(LDFLAGS) -o $@ bgzip.o libhts.a $(LIBS) -lpthread
322
323 htsfile: htsfile.o libhts.a
324 $(CC) $(LDFLAGS) -o $@ htsfile.o libhts.a $(LIBS) -lpthread
325
326 tabix: tabix.o libhts.a
327 $(CC) $(LDFLAGS) -o $@ tabix.o libhts.a $(LIBS) -lpthread
328
329 bgzip.o: bgzip.c config.h $(htslib_bgzf_h) $(htslib_hts_h)
330 htsfile.o: htsfile.c config.h $(htslib_hfile_h) $(htslib_hts_h) $(htslib_sam_h) $(htslib_vcf_h)
331 tabix.o: tabix.c config.h $(htslib_tbx_h) $(htslib_sam_h) $(htslib_vcf_h) $(htslib_kseq_h) $(htslib_bgzf_h) $(htslib_hts_h) $(htslib_regidx_h)
332
333
334 # For tests that might use it, set $REF_PATH explicitly to use only reference
335 # areas within the test suite (or set it to ':' to use no reference areas).
336 #
337 # If using MSYS, avoid poor shell expansion via:
338 # MSYS2_ARG_CONV_EXCL="*" make check
339 check test: $(BUILT_PROGRAMS) $(BUILT_TEST_PROGRAMS)
340
341 install: libhts.a $(BUILT_PROGRAMS) $(BUILT_PLUGINS) installdirs install-$(SHLIB_FLAVOUR) install-pkgconfig
342 $(INSTALL_PROGRAM) $(BUILT_PROGRAMS) $(DESTDIR)$(bindir)
343 if test -n "$(BUILT_PLUGINS)"; then $(INSTALL_PROGRAM) $(BUILT_PLUGINS) $(DESTDIR)$(plugindir); fi
344 $(INSTALL_DATA) htslib/*.h $(DESTDIR)$(includedir)/htslib
345 $(INSTALL_DATA) libhts.a $(DESTDIR)$(libdir)/libhts.a
346 $(INSTALL_MAN) bgzip.1 htsfile.1 tabix.1 $(DESTDIR)$(man1dir)
347 $(INSTALL_MAN) faidx.5 sam.5 vcf.5 $(DESTDIR)$(man5dir)
348
349 installdirs:
350 $(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(includedir) $(DESTDIR)$(includedir)/htslib $(DESTDIR)$(libdir) $(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir) $(DESTDIR)$(pkgconfigdir)
351 if test -n "$(plugindir)"; then $(INSTALL_DIR) $(DESTDIR)$(plugindir); fi
352
353 # After installation, the real file in $(libdir) will be libhts.so.X.Y.Z,
354 # with symlinks libhts.so (used via -lhts during linking of client programs)
355 # and libhts.so.NN (used by client executables at runtime).
356
357 install-so: libhts.so installdirs
358 $(INSTALL_LIB) libhts.so $(DESTDIR)$(libdir)/libhts.so.$(PACKAGE_VERSION)
359 ln -sf libhts.so.$(PACKAGE_VERSION) $(DESTDIR)$(libdir)/libhts.so
360 ln -sf libhts.so.$(PACKAGE_VERSION) $(DESTDIR)$(libdir)/libhts.so.$(LIBHTS_SOVERSION)
361
362 install-cygdll: cyghts-$(LIBHTS_SOVERSION).dll installdirs
363 $(INSTALL_PROGRAM) cyghts-$(LIBHTS_SOVERSION).dll $(DESTDIR)$(bindir)/cyghts-$(LIBHTS_SOVERSION).dll
364 $(INSTALL_PROGRAM) libhts.dll.a $(DESTDIR)$(libdir)/libhts.dll.a
365
366 install-dll: hts-$(LIBHTS_SOVERSION).dll installdirs
367 $(INSTALL_PROGRAM) hts-$(LIBHTS_SOVERSION).dll $(DESTDIR)$(bindir)/hts-$(LIBHTS_SOVERSION).dll
368 $(INSTALL_PROGRAM) hts.dll.a $(DESTDIR)$(libdir)/hts.dll.a
369
370 install-dylib: libhts.dylib installdirs
371 $(INSTALL_PROGRAM) libhts.dylib $(DESTDIR)$(libdir)/libhts.$(PACKAGE_VERSION).dylib
372 ln -sf libhts.$(PACKAGE_VERSION).dylib $(DESTDIR)$(libdir)/libhts.dylib
373 ln -sf libhts.$(PACKAGE_VERSION).dylib $(DESTDIR)$(libdir)/libhts.$(LIBHTS_SOVERSION).dylib
374
375 # Substitute these pseudo-autoconf variables only at install time
376 # so that "make install prefix=/prefix/path" etc continue to work.
377 install-pkgconfig: htslib.pc.tmp installdirs
378 sed -e 's#@-includedir@#$(includedir)#g;s#@-libdir@#$(libdir)#g;s#@-PACKAGE_VERSION@#$(PACKAGE_VERSION)#g' htslib.pc.tmp > $(DESTDIR)$(pkgconfigdir)/htslib.pc
379 chmod 644 $(DESTDIR)$(pkgconfigdir)/htslib.pc
380
381 # A pkg-config file (suitable for copying to $PKG_CONFIG_PATH) that provides
382 # flags for building against the uninstalled library in this build directory.
383 htslib-uninstalled.pc: htslib.pc.tmp
384 sed -e 's#@-includedir@#'`pwd`'#g;s#@-libdir@#'`pwd`'#g' htslib.pc.tmp > $@
385
386
387 testclean:
388 -rm -f test/*.tmp test/*.tmp.* test/tabix/*.tmp.* test/tabix/FAIL*
389
390 mostlyclean: testclean
391 -rm -f *.o *.pico cram/*.o cram/*.pico test/*.o test/*.dSYM version.h
392
393 clean: mostlyclean clean-$(SHLIB_FLAVOUR)
394 -rm -f libhts.a $(BUILT_PROGRAMS) $(BUILT_PLUGINS) $(BUILT_TEST_PROGRAMS) $(BUILT_THRASH_PROGRAMS)
395
396 distclean maintainer-clean: clean
397 -rm -f config.cache config.h config.log config.mk config.status
398 -rm -f TAGS *.pc.tmp *-uninstalled.pc htslib_static.mk
399 -rm -rf autom4te.cache
400
401 clean-so:
402 -rm -f libhts.so libhts.so.*
403
404 clean-cygdll:
405 -rm -f cyghts-*.dll libhts.dll.a
406
407 clean-dll:
408 -rm -f hts-*.dll hts.dll.a
409
410 clean-dylib:
411 -rm -f libhts.dylib libhts.*.dylib
412
413
414 tags TAGS:
415 ctags -f TAGS *.[ch] cram/*.[ch] htslib/*.h
416
417 # We recommend libhts-using programs be built against a separate htslib
418 # installation. However if you feel that you must bundle htslib source
419 # code with your program, this hook enables Automake-style "make dist"
420 # for this subdirectory. If you do bundle an htslib snapshot, please
421 # add identifying information to $(PACKAGE_VERSION) as appropriate.
422 # (The wildcards attempt to omit non-exported files (.git*, README.md,
423 # etc) and other detritus that might be in the top-level directory.)
424 distdir:
425 @if [ -z "$(distdir)" ]; then echo "Please supply a distdir=DIR argument."; false; fi
426 tar -c *.[ch15] [ILMNRchtv]*[ELSbcekmnth] | (cd $(distdir) && tar -x)
427 +cd $(distdir) && $(MAKE) distclean
428
429 force:
430
431
432 .PHONY: all check clean distclean distdir force
433 .PHONY: install install-pkgconfig installdirs lib-shared lib-static
434 .PHONY: maintainer-clean mostlyclean plugins print-config print-version
435 .PHONY: show-version tags test testclean
436 .PHONY: clean-so install-so
437 .PHONY: clean-cygdll install-cygdll
438 .PHONY: clean-dll install-dll
439 .PHONY: clean-dylib install-dylib