0
|
1 # Makefile rules useful for third-party code using htslib's public API.
|
|
2 #
|
|
3 # Copyright (C) 2013-2015 Genome Research Ltd.
|
|
4 #
|
|
5 # Author: John Marshall <jm18@sanger.ac.uk>
|
|
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 # 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:
|
|
29 #
|
|
30 # HTSDIR = <path to htslib top-level directory>
|
|
31 # include $(HTSDIR)/htslib.mk
|
|
32 #
|
|
33 # foo.o: foo.c $(htslib_hts_h) $(HTSDIR)/htslib/kstring.h
|
|
34 #
|
|
35 # Variables are not provided for k*.h, as those never include other headers.
|
|
36
|
|
37 HTSPREFIX = $(HTSDIR)/
|
|
38 include $(HTSDIR)/htslib_vars.mk
|
|
39
|
|
40 # Rules for rebuilding an in-development htslib's static and shared libraries.
|
|
41 # If your program foo links with libhts, adding the appropriate prerequisite
|
|
42 # will cause the library to be rebuilt as necessary:
|
|
43 #
|
|
44 # foo: foo.o $(HTSDIR)/libhts.a
|
|
45 #
|
|
46 # or similarly if your target requires any of the tools supplied:
|
|
47 #
|
|
48 # bar.bed.bgz.tbi: bar.bed.bgz $(HTSDIR)/tabix
|
|
49 # $(HTSDIR)/tabix -p bed bar.bed.bgz
|
|
50
|
|
51 HTSLIB_PUBLIC_HEADERS = \
|
|
52 $(HTSDIR)/htslib/bgzf.h \
|
|
53 $(HTSDIR)/htslib/faidx.h \
|
|
54 $(HTSDIR)/htslib/hfile.h \
|
|
55 $(HTSDIR)/htslib/hts.h \
|
|
56 $(HTSDIR)/htslib/hts_defs.h \
|
|
57 $(HTSDIR)/htslib/khash.h \
|
|
58 $(HTSDIR)/htslib/klist.h \
|
|
59 $(HTSDIR)/htslib/knetfile.h \
|
|
60 $(HTSDIR)/htslib/kseq.h \
|
|
61 $(HTSDIR)/htslib/ksort.h \
|
|
62 $(HTSDIR)/htslib/kstring.h \
|
|
63 $(HTSDIR)/htslib/regidx.h \
|
|
64 $(HTSDIR)/htslib/sam.h \
|
|
65 $(HTSDIR)/htslib/synced_bcf_reader.h \
|
|
66 $(HTSDIR)/htslib/tbx.h \
|
|
67 $(HTSDIR)/htslib/vcf.h \
|
|
68 $(HTSDIR)/htslib/vcf_sweep.h \
|
|
69 $(HTSDIR)/htslib/vcfutils.h
|
|
70
|
|
71 HTSLIB_ALL = \
|
|
72 $(HTSLIB_PUBLIC_HEADERS) \
|
|
73 $(HTSDIR)/bgzf.c \
|
|
74 $(HTSDIR)/faidx.c \
|
|
75 $(HTSDIR)/hfile_internal.h \
|
|
76 $(HTSDIR)/hfile.c \
|
|
77 $(HTSDIR)/hfile_irods.c \
|
|
78 $(HTSDIR)/hfile_net.c \
|
|
79 $(HTSDIR)/hts.c \
|
|
80 $(HTSDIR)/knetfile.c \
|
|
81 $(HTSDIR)/kstring.c \
|
|
82 $(HTSDIR)/regidx.c \
|
|
83 $(HTSDIR)/sam.c \
|
|
84 $(HTSDIR)/synced_bcf_reader.c \
|
|
85 $(HTSDIR)/tbx.c \
|
|
86 $(HTSDIR)/vcf.c \
|
|
87 $(HTSDIR)/vcf_sweep.c \
|
|
88 $(HTSDIR)/vcfutils.c \
|
|
89 $(HTSDIR)/cram/cram.h \
|
|
90 $(HTSDIR)/cram/cram_codecs.c \
|
|
91 $(HTSDIR)/cram/cram_codecs.h \
|
|
92 $(HTSDIR)/cram/cram_decode.c \
|
|
93 $(HTSDIR)/cram/cram_decode.h \
|
|
94 $(HTSDIR)/cram/cram_encode.c \
|
|
95 $(HTSDIR)/cram/cram_encode.h \
|
|
96 $(HTSDIR)/cram/cram_index.c \
|
|
97 $(HTSDIR)/cram/cram_index.h \
|
|
98 $(HTSDIR)/cram/cram_io.c \
|
|
99 $(HTSDIR)/cram/cram_io.h \
|
|
100 $(HTSDIR)/cram/cram_samtools.c \
|
|
101 $(HTSDIR)/cram/cram_samtools.h \
|
|
102 $(HTSDIR)/cram/cram_stats.c \
|
|
103 $(HTSDIR)/cram/cram_stats.h \
|
|
104 $(HTSDIR)/cram/cram_structs.h \
|
|
105 $(HTSDIR)/cram/files.c \
|
|
106 $(HTSDIR)/cram/mFILE.c \
|
|
107 $(HTSDIR)/cram/mFILE.h \
|
|
108 $(HTSDIR)/cram/md5.c \
|
|
109 $(HTSDIR)/cram/md5.h \
|
|
110 $(HTSDIR)/cram/misc.h \
|
|
111 $(HTSDIR)/cram/open_trace_file.c \
|
|
112 $(HTSDIR)/cram/open_trace_file.h \
|
|
113 $(HTSDIR)/cram/os.h \
|
|
114 $(HTSDIR)/cram/pooled_alloc.c \
|
|
115 $(HTSDIR)/cram/pooled_alloc.h \
|
|
116 $(HTSDIR)/cram/sam_header.c \
|
|
117 $(HTSDIR)/cram/sam_header.h \
|
|
118 $(HTSDIR)/cram/string_alloc.c \
|
|
119 $(HTSDIR)/cram/string_alloc.h \
|
|
120 $(HTSDIR)/cram/thread_pool.c \
|
|
121 $(HTSDIR)/cram/thread_pool.h \
|
|
122 $(HTSDIR)/cram/vlen.c \
|
|
123 $(HTSDIR)/cram/vlen.h \
|
|
124 $(HTSDIR)/cram/zfio.c \
|
|
125 $(HTSDIR)/cram/zfio.h
|
|
126
|
|
127 $(HTSDIR)/libhts.a: $(HTSLIB_ALL)
|
|
128 +cd $(HTSDIR) && $(MAKE) lib-static
|
|
129
|
|
130 $(HTSDIR)/libhts.so $(HTSDIR)/libhts.dylib: $(HTSLIB_ALL)
|
|
131 +cd $(HTSDIR) && $(MAKE) lib-shared
|
|
132
|
|
133 $(HTSDIR)/bgzip: $(HTSDIR)/bgzip.c $(HTSLIB_PUBLIC_HEADERS)
|
|
134 +cd $(HTSDIR) && $(MAKE) bgzip
|
|
135
|
|
136 $(HTSDIR)/htsfile: $(HTSDIR)/htsfile.c $(HTSLIB_PUBLIC_HEADERS)
|
|
137 +cd $(HTSDIR) && $(MAKE) htsfile
|
|
138
|
|
139 $(HTSDIR)/tabix: $(HTSDIR)/tabix.c $(HTSLIB_PUBLIC_HEADERS)
|
|
140 +cd $(HTSDIR) && $(MAKE) tabix
|
|
141
|
|
142 # Rules for phony targets. You may wish to have your corresponding phony
|
|
143 # targets invoke these in addition to their own recipes:
|
|
144 #
|
|
145 # clean: clean-htslib
|
|
146
|
|
147 clean-htslib install-htslib:
|
|
148 +cd $(HTSDIR) && $(MAKE) $(@:-htslib=)
|
|
149
|
|
150 .PHONY: clean-htslib install-htslib
|