forked from samtools/samtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
181 lines (134 loc) · 6.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Makefile for samtools, utilities for the Sequence Alignment/Map format.
#
# Copyright (C) 2008-2013 Genome Research Ltd.
CC = gcc
CPPFLAGS = $(DFLAGS) $(INCLUDES)
CFLAGS = -g -Wall -O2
LDFLAGS =
DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_CURSES_LIB=1
LOBJS= bam_aux.o bam.o bam_import.o sam.o \
sam_header.o
AOBJS= bam_index.o bam_plcmd.o sam_view.o \
bam_cat.o bam_md.o bam_reheader.o bam_sort.o bedidx.o kprobaln.o \
bam_rmdup.o bam_rmdupse.o bam_mate.o bam_stat.o bam_color.o \
bamtk.o kaln.o bam2bcf.o bam2bcf_indel.o errmod.o sample.o \
cut_target.o phase.o bam2depth.o padding.o bedcov.o bamshuf.o \
faidx.o stats.o
# tview todo: bam_tview.o bam_tview_curses.o bam_tview_html.o bam_lpileup.o
INCLUDES= -I. -I$(HTSDIR)
LIBCURSES= -lcurses # -lXCurses
PROGRAMS = samtools bgzip
MISC_PROGRAMS = \
misc/ace2sam misc/maq2sam-long misc/maq2sam-short \
misc/md5fa misc/md5sum-lite misc/wgsim
all: $(PROGRAMS) $(MISC_PROGRAMS)
# Adjust $(HTSDIR) to point to your top-level htslib directory
HTSDIR = ../htslib
include $(HTSDIR)/htslib.mk
HTSLIB = $(HTSDIR)/libhts.a
PACKAGE_VERSION = 0.2.0
# If building from a Git repository, replace $(PACKAGE_VERSION) with the Git
# description of the working tree: either a release tag with the same value
# as $(PACKAGE_VERSION) above, or an exact description likely based on a tag.
# $(shell), :=, etc are GNU Make-specific. If you don't have GNU Make,
# comment out this conditional.
ifneq "$(wildcard .git)" ""
PACKAGE_VERSION := $(shell git describe --always --dirty)
# Force version.h to be remade if $(PACKAGE_VERSION) has changed.
version.h: $(if $(wildcard version.h),$(if $(findstring "$(PACKAGE_VERSION)",$(shell cat version.h)),,force))
endif
# If you don't have GNU Make but are building from a Git repository, you may
# wish to replace this with a rule that always rebuilds version.h:
# version.h: force
# echo '#define SAMTOOLS_VERSION "`git describe --always --dirty`"' > $@
version.h:
echo '#define SAMTOOLS_VERSION "$(PACKAGE_VERSION)"' > $@
.SUFFIXES: .c .o
.c.o:
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
lib:libbam.a
libbam.a:$(LOBJS)
$(AR) -csru $@ $(LOBJS)
samtools: $(AOBJS) libbam.a $(HTSLIB)
$(CC) -pthread $(LDFLAGS) -o $@ $(AOBJS) libbam.a $(HTSLIB) $(LDLIBS) $(LIBCURSES) -lm -lz
bgzip: bgzip.o $(HTSLIB)
$(CC) -pthread $(LDFLAGS) -o $@ bgzip.o $(HTSLIB) -lz
bam_h = bam.h $(htslib_bgzf_h) $(htslib_sam_h)
bam2bcf_h = bam2bcf.h errmod.h
bam_tview_h = bam_tview.h $(bam_h) $(htslib_faidx_h) $(bam2bcf_h) sam_header.h $(HTSDIR)/htslib/khash.h
sam_h = sam.h $(htslib_sam_h) $(bam_h)
sample_h = sample.h $(HTSDIR)/htslib/kstring.h
bam.o: bam.c $(bam_h) sam_header.h
bam2bcf.o: bam2bcf.c bam2bcf.h $(HTSDIR)/htslib/kfunc.h
bam2bcf_indel.o: bam2bcf_indel.c bam2bcf.h
bam2depth.o: bam2depth.c
bam_aux.o: bam_aux.c
bam_cat.o: bam_cat.c $(htslib_bgzf_h) $(bam_h)
bam_color.o: bam_color.c $(bam_h)
bam_import.o: bam_import.c $(HTSDIR)/htslib/kstring.h $(bam_h) $(HTSDIR)/htslib/kseq.h
bam_index.o: bam_index.c $(bam_h)
bam_lpileup.o: bam_lpileup.c $(bam_h) $(HTSDIR)/htslib/ksort.h
bam_mate.o: bam_mate.c $(bam_h)
bam_md.o: bam_md.c $(htslib_faidx_h) $(sam_h) kaln.h kprobaln.h
bam_pileup.o: bam_pileup.c $(sam_h)
bam_plcmd.o: bam_plcmd.c $(sam_h) $(htslib_faidx_h) sam_header.h $(bam2bcf_h) $(sample_h)
bam_reheader.o: bam_reheader.c $(htslib_bgzf_h) $(bam_h)
bam_rmdup.o: bam_rmdup.c $(sam_h) $(HTSDIR)/htslib/khash.h
bam_rmdupse.o: bam_rmdupse.c $(sam_h) $(HTSDIR)/htslib/khash.h $(HTSDIR)/htslib/klist.h
bam_sort.o: bam_sort.c $(bam_h) $(HTSDIR)/htslib/ksort.h
bam_stat.o: bam_stat.c $(bam_h)
bam_tview.o: bam_tview.c $(bam_tview_h)
bam_tview_curses.o: bam_tview_curses.c $(bam_tview_h)
bam_tview_html.o: bam_tview_html.c $(bam_tview_h)
bamshuf.o: bamshuf.c $(htslib_sam_h) $(HTSDIR)/htslib/ksort.h
bamtk.o: bamtk.c $(bam_h) version.h samtools.h
bedcov.o: bedcov.c $(htslib_bgzf_h) $(bam_h) $(HTSDIR)/htslib/kseq.h
bedidx.o: bedidx.c $(HTSDIR)/htslib/ksort.h $(HTSDIR)/htslib/kseq.h $(HTSDIR)/htslib/khash.h
bgzip.o: bgzip.c $(htslib_bgzf_h)
cut_target.o: cut_target.c $(bam_h) errmod.h $(htslib_faidx_h)
errmod.o: errmod.c errmod.h $(HTSDIR)/htslib/ksort.h
kaln.o: kaln.c kaln.h
kprobaln.o: kprobaln.c kprobaln.h
padding.o: padding.c sam_header.h $(sam_h) $(bam_h) $(htslib_faidx_h)
phase.o: phase.c $(bam_h) errmod.h $(HTSDIR)/htslib/kseq.h $(HTSDIR)/htslib/khash.h $(HTSDIR)/htslib/ksort.h
sam.o: sam.c $(htslib_faidx_h) $(sam_h)
sam_header.o: sam_header.c sam_header.h $(HTSDIR)/htslib/khash.h
sam_view.o: sam_view.c sam_header.h $(sam_h) $(htslib_faidx_h) $(HTSDIR)/htslib/khash.h
sample.o: sample.c $(sample_h) $(HTSDIR)/htslib/khash.h
stats.o: stats.c $(sam_h) sam_header.h khash_utils.h samtools.h $(HTSDIR)/htslib/khash.h $(htslib_faidx_h)
# test programs
check test:
test/test.pl
# misc programs
misc/ace2sam: misc/ace2sam.o
$(CC) $(LDFLAGS) -o $@ misc/ace2sam.o $(LDLIBS) -lz
misc/maq2sam-short: misc/maq2sam-short.o
$(CC) $(LDFLAGS) -o $@ misc/maq2sam-short.o $(LDLIBS) -lz
misc/maq2sam-long: misc/maq2sam-long.o
$(CC) $(LDFLAGS) -o $@ misc/maq2sam-long.o $(LDLIBS) -lz
misc/md5fa: misc/md5fa.o misc/md5.o
$(CC) $(LDFLAGS) -o $@ misc/md5fa.o misc/md5.o $(LDLIBS) -lz
misc/md5sum-lite: misc/md5sum-lite.o
$(CC) $(LDFLAGS) -o $@ misc/md5sum-lite.o $(LDLIBS)
misc/wgsim: misc/wgsim.o
$(CC) $(LDFLAGS) -o $@ misc/wgsim.o $(LDLIBS) -lm -lz
misc/ace2sam.o: misc/ace2sam.c $(HTSDIR)/htslib/kstring.h $(HTSDIR)/htslib/kseq.h
misc/md5.o: misc/md5.c misc/md5.h
misc/md5fa.o: misc/md5fa.c misc/md5.h $(HTSDIR)/htslib/kseq.h
misc/wgsim.o: misc/wgsim.c $(HTSDIR)/htslib/kseq.h
misc/maq2sam-short.o: misc/maq2sam.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ misc/maq2sam.c
misc/maq2sam-long.o: misc/maq2sam.c
$(CC) $(CFLAGS) $(CPPFLAGS) -DMAQ_LONGREADS -c -o $@ misc/maq2sam.c
misc/md5sum-lite.o: misc/md5.c misc/md5.h
$(CC) $(CFLAGS) $(CPPFLAGS) -DMD5SUM_MAIN -c -o $@ misc/md5.c
mostlyclean:
-rm -f *.o misc/*.o version.h
clean: mostlyclean clean-htslib
-rm -f $(PROGRAMS) libbam.a $(MISC_PROGRAMS)
distclean: clean
-rm -f TAGS
tags:
ctags -f TAGS *.[ch] misc/*.[ch]
force:
.PHONY: all check clean distclean force lib mostlyclean tags test