1 # Makefile rules useful for third-party code using htslib's public API.
3 # Copyright (C) 2013-2016 Genome Research Ltd.
5 # Author: John Marshall <jm18@sanger.ac.uk>
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:
14 # The above copyright notice and this permission notice shall be included in
15 # all copies or substantial portions of the Software.
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.
25 # The makefile fragment included below provides variables that can be used
26 # to express dependencies on headers supplied by an in-development htslib.
27 # If your source file foo.c #includes <htslib/hts.h> and <htslib/kstring.h>,
28 # you can write the correct prerequisites for foo.o as:
30 # HTSDIR = <path to htslib top-level directory>
31 # include $(HTSDIR)/htslib.mk
33 # foo.o: foo.c $(htslib_hts_h) $(htslib_kstring_h)
35 HTSPREFIX
= $(HTSDIR
)/
36 include $(HTSDIR
)/htslib_vars.mk
38 # Rules for rebuilding an in-development htslib's static and shared libraries.
39 # If your program foo links with libhts, adding the appropriate prerequisite
40 # will cause the library to be rebuilt as necessary:
42 # foo: foo.o $(HTSDIR)/libhts.a
44 # or similarly if your target requires any of the tools supplied:
46 # bar.bed.bgz.tbi: bar.bed.bgz $(HTSDIR)/tabix
47 # $(HTSDIR)/tabix -p bed bar.bed.bgz
49 HTSLIB_PUBLIC_HEADERS
= \
50 $(HTSDIR
)/htslib
/bgzf.h \
51 $(HTSDIR
)/htslib
/cram.h \
52 $(HTSDIR
)/htslib
/faidx.h \
53 $(HTSDIR
)/htslib
/hfile.h \
54 $(HTSDIR
)/htslib
/hts.h \
55 $(HTSDIR
)/htslib
/hts_defs.h \
56 $(HTSDIR
)/htslib
/hts_endian.h \
57 $(HTSDIR
)/htslib
/hts_log.h \
58 $(HTSDIR
)/htslib
/kbitset.h \
59 $(HTSDIR
)/htslib
/kfunc.h \
60 $(HTSDIR
)/htslib
/khash.h \
61 $(HTSDIR
)/htslib
/khash_str2int.h \
62 $(HTSDIR
)/htslib
/klist.h \
63 $(HTSDIR
)/htslib
/knetfile.h \
64 $(HTSDIR
)/htslib
/kseq.h \
65 $(HTSDIR
)/htslib
/ksort.h \
66 $(HTSDIR
)/htslib
/kstring.h \
67 $(HTSDIR
)/htslib
/regidx.h \
68 $(HTSDIR
)/htslib
/sam.h \
69 $(HTSDIR
)/htslib
/synced_bcf_reader.h \
70 $(HTSDIR
)/htslib
/tbx.h \
71 $(HTSDIR
)/htslib
/thread_pool.h \
72 $(HTSDIR
)/htslib
/vcf.h \
73 $(HTSDIR
)/htslib
/vcf_sweep.h \
74 $(HTSDIR
)/htslib
/vcfutils.h
77 $(HTSLIB_PUBLIC_HEADERS
) \
78 $(HTSDIR
)/bcf_sr_sort.c \
79 $(HTSDIR
)/bcf_sr_sort.h \
84 $(HTSDIR
)/hfile_internal.h \
86 $(HTSDIR
)/hfile_gcs.c \
87 $(HTSDIR
)/hfile_libcurl.c \
88 $(HTSDIR
)/hfile_net.c \
89 $(HTSDIR
)/hfile_s3.c \
91 $(HTSDIR
)/hts_internal.h \
93 $(HTSDIR
)/knetfile.c \
96 $(HTSDIR
)/multipart.c \
102 $(HTSDIR
)/synced_bcf_reader.c \
104 $(HTSDIR
)/textutils.c \
105 $(HTSDIR
)/thread_pool.c \
106 $(HTSDIR
)/thread_pool_internal.h \
108 $(HTSDIR
)/vcf_sweep.c \
109 $(HTSDIR
)/vcfutils.c \
110 $(HTSDIR
)/cram
/cram.h \
111 $(HTSDIR
)/cram
/cram_codecs.c \
112 $(HTSDIR
)/cram
/cram_codecs.h \
113 $(HTSDIR
)/cram
/cram_decode.c \
114 $(HTSDIR
)/cram
/cram_decode.h \
115 $(HTSDIR
)/cram
/cram_encode.c \
116 $(HTSDIR
)/cram
/cram_encode.h \
117 $(HTSDIR
)/cram
/cram_external.c \
118 $(HTSDIR
)/cram
/cram_index.c \
119 $(HTSDIR
)/cram
/cram_index.h \
120 $(HTSDIR
)/cram
/cram_io.c \
121 $(HTSDIR
)/cram
/cram_io.h \
122 $(HTSDIR
)/cram
/cram_samtools.c \
123 $(HTSDIR
)/cram
/cram_samtools.h \
124 $(HTSDIR
)/cram
/cram_stats.c \
125 $(HTSDIR
)/cram
/cram_stats.h \
126 $(HTSDIR
)/cram
/cram_structs.h \
127 $(HTSDIR
)/cram
/files.c \
128 $(HTSDIR
)/cram
/mFILE.c \
129 $(HTSDIR
)/cram
/mFILE.h \
130 $(HTSDIR
)/cram
/misc.h \
131 $(HTSDIR
)/cram
/open_trace_file.c \
132 $(HTSDIR
)/cram
/open_trace_file.h \
133 $(HTSDIR
)/cram
/os.h \
134 $(HTSDIR
)/cram
/pooled_alloc.c \
135 $(HTSDIR
)/cram
/pooled_alloc.h \
136 $(HTSDIR
)/cram
/rANS_byte.h \
137 $(HTSDIR
)/cram
/rANS_static.c \
138 $(HTSDIR
)/cram
/rANS_static.h \
139 $(HTSDIR
)/cram
/sam_header.c \
140 $(HTSDIR
)/cram
/sam_header.h \
141 $(HTSDIR
)/cram
/string_alloc.c \
142 $(HTSDIR
)/cram
/string_alloc.h
145 +cd
$(HTSDIR
) && $(MAKE
) config.h
147 $(HTSDIR
)/libhts.a
: $(HTSLIB_ALL
)
148 +cd
$(HTSDIR
) && $(MAKE
) lib-static
150 $(HTSDIR
)/libhts.so
$(HTSDIR
)/libhts.dylib
: $(HTSLIB_ALL
)
151 +cd
$(HTSDIR
) && $(MAKE
) lib-shared
153 $(HTSDIR
)/bgzip
: $(HTSDIR
)/bgzip.c
$(HTSLIB_PUBLIC_HEADERS
)
154 +cd
$(HTSDIR
) && $(MAKE
) bgzip
156 $(HTSDIR
)/htsfile
: $(HTSDIR
)/htsfile.c
$(HTSLIB_PUBLIC_HEADERS
)
157 +cd
$(HTSDIR
) && $(MAKE
) htsfile
159 $(HTSDIR
)/tabix
: $(HTSDIR
)/tabix.c
$(HTSLIB_PUBLIC_HEADERS
)
160 +cd
$(HTSDIR
) && $(MAKE
) tabix
162 $(HTSDIR
)/htslib_static.mk
: $(HTSDIR
)/htslib.
pc.tmp
163 +cd
$(HTSDIR
) && $(MAKE
) htslib_static.mk
165 $(HTSDIR
)/htslib.
pc.tmp
:
166 +cd
$(HTSDIR
) && $(MAKE
) htslib.
pc.tmp
168 # Rules for phony targets. You may wish to have your corresponding phony
169 # targets invoke these in addition to their own recipes:
171 # clean: clean-htslib
173 all-htslib clean-htslib install-htslib plugins-htslib
:
174 +cd
$(HTSDIR
) && $(MAKE
) $(@
:-htslib
=)
176 .PHONY
: all-htslib clean-htslib install-htslib plugins-htslib