forked from compbio-UofT/shrimp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
271 lines (206 loc) · 7.58 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
ifndef BUILD_TYPE
BUILD_TYPE=production
endif
ifdef USE_ICC
CXX=/opt/intel/cce/10.1.015/bin/icc
endif
ifndef CXXFLAGS
ifeq ($(BUILD_TYPE), production)
CXXFLAGS=-O3 -DNDEBUG
else
ifeq ($(BUILD_TYPE), testing)
CXXFLAGS=-g -O3
else
CXXFLAGS=-g
endif
endif
ifdef USE_ICC
CXXFLAGS+=-Kc++ -wd383,981,1572 -axP -ipo -openmp -static-intel
else
CXXFLAGS+=-mmmx -msse -msse2 -fopenmp -Wall -Wno-deprecated
endif
endif
GIT_VERSION=$(shell ./get_git_version)
override CXXFLAGS+=-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DGIT_VERSION=$(GIT_VERSION)
LD=$(CXX)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
LDFLAGS=-lm -lz -lstdc++
else
LDFLAGS=-lm -lz -lstdc++ -lrt
endif
LN=ln
all: bin/gmapper bin/probcalc bin/prettyprint bin/probcalc_mp \
bin/shrimp_var bin/shrimp2sam utils/split-contigs bin/fasta2fastq bin/mergesam utils/temp-sink
#
# mapper /
#
mapper/mapper.o: mapper/mapper.c mapper/mapper.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
#
# gmapper /
#
bin/gmapper: gmapper/gmapper.o gmapper/seeds.o gmapper/genome.o gmapper/mapping.o gmapper/output.o \
common/fasta.o common/util.o \
common/bitmap.o common/sw-vector.o common/sw-gapless.o common/sw-full-cs.o \
common/sw-full-ls.o common/output.o common/anchors.o common/input.o \
common/read_hit_heap.o common/sw-post.o common/my-alloc.o common/gen-st.o
$(LD) $(CXXFLAGS) -o $@ $+ $(LDFLAGS)
$(LN) -sf gmapper bin/gmapper-cs
$(LN) -sf gmapper bin/gmapper-ls
gmapper/gmapper.o: gmapper/gmapper.c common/bitmap.h gmapper/gmapper.h gmapper/gmapper-defaults.h \
common/debug.h common/f1-wrapper.h common/version.h
$(CXX) $(CXXFLAGS) -DCXXFLAGS="\"$(CXXFLAGS)\"" -c -o $@ $<
bin/lineindex: mergesam/lineindex.o mergesam/lineindex_lib.o mergesam/file_buffer.o
$(LD) $(CXXFLAGS) -o $@ $+ $(LDFLAGS)
bin/fasta2fastq: mergesam/file_buffer.o mergesam/fasta_reader.o mergesam/fasta2fastq.o mergesam/lineindex_lib.o
$(LD) $(CXXFLAGS) -o $@ $+ $(LDFLAGS)
mergesam/fasta_reader.o: mergesam/fasta_reader.c mergesam/fasta_reader.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
bin/mergesam: mergesam/file_buffer.o mergesam/sam2pretty_lib.o mergesam/mergesam_heap.o mergesam/mergesam.o mergesam/fastx_readnames.o mergesam/sam_reader.o mergesam/render.o
$(LD) $(CXXFLAGS) -o $@ $+ $(LDFLAGS)
mergesam/mergesam.o: mergesam/mergesam.c
$(CXX) $(CXXFLAGS) -c -o $@ $<
mergesam/mergesam_heap.o: mergesam/mergesam_heap.c mergesam/mergesam_heap.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
mergesam/file_buffer.o: mergesam/file_buffer.c mergesam/file_buffer.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
mergesam/sam_reader.o: mergesam/sam_reader.c mergesam/sam_reader.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
mergesam/fastx_readnames.o: mergesam/fastx_readnames.c mergesam/fastx_readnames.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
mergesam/sam2pretty_lib.o: mergesam/sam2pretty_lib.c mergesam/sam2pretty_lib.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
mergesam/fasta2fastq.o: mergesam/fasta2fastq.c
$(CXX) $(CXXFLAGS) -c -o $@ $<
mergesam/lineindex.o: mergesam/lineindex.c
$(CXX) $(CXXFLAGS) -c -o $@ $<
mergesam/lineindex_lib.o: mergesam/lineindex_lib.c
$(CXX) $(CXXFLAGS) -c -o $@ $<
mergesam/render.o: mergesam/render.c mergesam/render.h mergesam/sam2pretty_lib.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
#
# probcalc
#
bin/probcalc: probcalc/probcalc.o common/fasta.o common/dynhash.o \
common/input.o common/output.o common/util.o
$(LD) $(CXXFLAGS) -o $@ $+ $(LDFLAGS)
probcalc/probcalc.o: probcalc/probcalc.c
$(CXX) $(CXXFLAGS) -c -o $@ $<
#
# probcalc_mp
#
bin/probcalc_mp: probcalc_mp/probcalc_mp.o
$(LD) $(CXXFLAGS) -o $@ $+ $(LDFLAGS)
probcalc_mp/probcalc_mp.o: probcalc_mp/probcalc_mp.c
$(CXX) $(CXXFLAGS) -c -o $@ $<
#
# shrimp_var
#
bin/shrimp_var: shrimp_var/shrimp_var.o
$(LD) $(CXXFLAGS) -o $@ $+ $(LDFLAGS)
shrimp_var/shrimp_var.o: shrimp_var/shrimp_var.c
$(CXX) $(CXXFLAGS) -c -o $@ $<
#
# prettyprint
#
bin/prettyprint: prettyprint/prettyprint.o common/fasta.o common/dynhash.o \
common/sw-full-cs.o common/sw-full-ls.o common/input.o common/output.o \
common/util.o common/anchors.o
$(LD) $(CXXFLAGS) -o $@ $+ $(LDFLAGS)
$(LN) -sf prettyprint bin/prettyprint-cs
$(LN) -sf prettyprint bin/prettyprint-ls
prettyprint/prettyprint.o: prettyprint/prettyprint.c common/version.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
#
# shrimp2sam
#
bin/shrimp2sam: shrimp2sam/shrimp2sam.o common/fasta.o common/dynhash.o \
common/input.o common/output.o \
common/util.o common/anchors.o
$(LD) $(CXXFLAGS) -o $@ $+ $(LDFLAGS)
$(LN) -sf prettyprint bin/prettyprint-ls
shrimp2sam/shrimp2sam.o: shrimp2sam/shrimp2sam.c common/version.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
#
# utils/split-contigs
#
utils/split-contigs: utils/split-contigs.o common/fasta.o common/util.o
$(LD) $(CXXFLAGS) -o $@ $+ $(LDFLAGS)
utils/split-contigs.o: utils/split-contigs.c
$(CXX) $(CXXFLAGS) -c -o $@ $<
#
# utils/temp-sink
#
utils/temp-sink: utils/temp-sink.o
$(LD) $(CXXFLAGS) -o $@ $+ $(LDFLAGS)
utils/temp-sink.o: utils/temp-sink.c
$(CXX) $(CXXFLAGS) -c -o $@ $<
#
# gmapper/
#
gmapper/seeds.o: gmapper/seeds.c gmapper/seeds.h gmapper/gmapper.h
$(LD) $(CXXFLAGS) -c -o $@ $<
gmapper/genome.o: gmapper/genome.c gmapper/genome.h gmapper/gmapper.h
$(LD) $(CXXFLAGS) -c -o $@ $<
gmapper/mapping.o: gmapper/mapping.c gmapper/mapping.h gmapper/gmapper.h
$(LD) $(CXXFLAGS) -c -o $@ $<
gmapper/output.o: gmapper/output.c gmapper/output.h gmapper/gmapper.h
$(LD) $(CXXFLAGS) -c -o $@ $<
#
# common/
#
common/read_hit_heap.o: common/read_hit_heap.c common/read_hit_heap.h gmapper/gmapper.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/fasta.o: common/fasta.c common/fasta.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/dag_align.o: common/dag_align.cpp common/dag_align.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/dag_glue.o: common/dag_glue.cpp common/dag_glue.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/dag_kmers.o: common/dag_kmers.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/dynhash.o: common/dynhash.c common/dynhash.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/input.o: common/input.c common/input.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/output.o: common/output.c common/output.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/sw-full-cs.o: common/sw-full-cs.c common/sw-full-cs.h \
common/sw-full-common.h common/util.h common/anchors.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/sw-full-ls.o: common/sw-full-ls.c common/sw-full-ls.h \
common/sw-full-common.h common/util.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/sw-vector.o: common/sw-vector.c common/sw-vector.h common/util.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/sw-gapless.o: common/sw-gapless.c common/sw-gapless.h common/util.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/util.o: common/util.c common/util.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/anchors.o: common/anchors.c common/anchors.h common/util.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/bitmap.o: common/bitmap.c common/bitmap.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/sw-post.o: common/sw-post.c common/sw-post.h common/util.h common/fasta.h common/sw-full-common.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/my-alloc.o: common/my-alloc.c common/my-alloc.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
common/gen-st.o: common/gen-st.c common/gen-st.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
#
# cleanup
#
clean:
rm -f bin/colourise bin/probcalc bin/gmapper* \
bin/prettyprint* bin/probcalc_mp bin/shrimp_var \
bin/shrimp2sam utils/split-contigs bin/mergesam utils/temp-sink bin/fasta2fastq
find . -name '*.o' |xargs rm -f
find . -name '*.core' |xargs rm -f
find . -name '*.pyc' |xargs rm -f
#
# unit tests
#
test: gmapper/seeds.o common/util.o common/bitmap.o common/my-alloc.o common/fasta.o tests/utest.c tests/test.c
$(LD) $(CXXFLAGS) -lcunit -o $@ $+ $(LDFLAGS)
tests: test