forked from zhou-lab/biscuit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
139 lines (109 loc) · 4.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
CFLAGS=-W -Wall -finline-functions -fPIC -std=gnu99
OS := $(shell uname)
ifeq ($(OS), Darwin)
CFLAGS += -Wno-unused-function
endif
INCLUDE = include
LSAM0119D = lib/libsamtools-0.1.19
LSAM0119 = $(LSAM0119D)/libsam.a
LUTILSD = lib/utils
LUTILS = lib/utils/libutils.a
PROG = biscuit
# PROG = hemifinder correct_bsstrand get_unmapped sample_trinuc
release : CFLAGS += -O3
release : $(PROG)
debug : CFLAGS += -g
debug : $(PROG)
$(LSAM0119) :
make -C $(LSAM0119D) libsam.a
.PHONY: klib
klib: lib/klib/klib.a
KLIBD = lib/klib
KLIBOBJ = $(KLIBD)/kstring.o $(KLIBD)/kopen.o $(KLIBD)/kthread.o $(KLIBD)/ksw.o
lib/klib/klib.a: $(KLIBOBJ)
ar -csru $@ $(KLIBOBJ)
$(KLIBD)/%.o: $(KLIBD)/%.c
gcc -c $(CFLAGS) -I$(INCLUDE)/klib $< -o $@
clean_klib:
rm -f $(KLIBD)/*.o lib/klib/klib.a
.PHONY: biscuit
LIBS=lib/aln/libaln.a src/pileup.o src/somatic.o src/markdup.o src/nome.o src/vcf2bed.o lib/klib/klib.a $(LSAM0119) $(LUTILS)
biscuit: bin/biscuit
bin/biscuit: $(LIBS) src/main.o
gcc $(CFLAGS) src/main.o -o $@ -I$(INCLUDE)/aln -I$(INCLUDE)/klib $(LIBS) -lpthread -lz -lm -lrt
src/main.o: src/main.c
gcc -c $(CFLAGS) src/main.c -o $@ -I$(INCLUDE) -I$(INCLUDE)/aln -I$(INCLUDE)/klib
####### libraries #######
.PHONY: utils
utils: $(LUTILS)
LUTILSOBJ = $(LUTILSD)/encode.o $(LUTILSD)/stats.o $(LUTILSD)/wzhmm.o
$(LUTILS): $(LUTILSOBJ)
ar -csru $@ $(LUTILSOBJ)
$(LUTILSD)/%.o: $(LUTILSD)/%.c
gcc -c $(CFLAGS) -I$(INCLUDE) $< -o $@
clean_utils:
rm -f $(LUTILSD)/*.o $(LUTILS)
libaln.a: $(ALNOBJS)
$(AR) -csru $@ $(ALNOBJS)
####### subcommands #######
.PHONY: aln
aln: lib/aln/libaln.a
LALND = lib/aln
LALNOBJ = $(LALND)/bntseq.o $(LALND)/bwamem.o $(LALND)/bwashm.o $(LALND)/bwt_gen.o $(LALND)/bwtsw2_chain.o $(LALND)/bwtsw2_pair.o $(LALND)/malloc_wrap.o $(LALND)/bwamem_extra.o $(LALND)/bwt.o $(LALND)/bwtindex.o $(LALND)/bwtsw2_core.o $(LALND)/fastmap.o $(LALND)/QSufSort.o $(LALND)/bwa.o $(LALND)/bwamem_pair.o $(LALND)/bwtgap.o $(LALND)/bwtsw2_aux.o $(LALND)/bwtsw2_main.o $(LALND)/is.o $(LALND)/utils.o
lib/aln/libaln.a: $(LALNOBJ)
ar -csru $@ $(LALNOBJ)
$(LALND)/%.o: $(LALND)/%.c
gcc -c $(CFLAGS) -I$(INCLUDE) -I$(INCLUDE)/aln -I$(INCLUDE)/klib $< -o $@
clean_aln:
rm -f $(LALND)/*.o lib/aln/libaln.a
src/pileup.o: src/pileup.c
gcc -c $(CFLAGS) -o $@ -I$(LSAM0119D) -I$(INCLUDE) src/pileup.c
clean_pileup:
rm -f src/pileup.o
src/somatic.o: src/somatic.c
gcc -c $(CFLAGS) -o $@ -I$(LSAM0119D) -I$(INCLUDE) src/somatic.c
clean_somatic:
rm -f src/somatic.o
src/markdup.o: src/markdup.c
gcc -c $(CFLAGS) -o $@ -I$(LSAM0119D) -I$(INCLUDE) src/markdup.c
clean_markdup:
rm -f src/markdup.o
src/nome.o: src/nome.c
gcc -c $(CFLAGS) -I$(INCLUDE) -I$(INCLUDE)/klib $< -o $@
src/vcf2bed.o: src/vcf2bed.c
gcc -c $(CFLAGS) -I$(INCLUDE) -I$(INCLUDE)/klib $< -o $@
####### general #######
.c.o :
gcc -c $(CFLAGS) $< -o $@
####### clean #######
.PHONY: clean
clean : clean_sample_trinuc clean_get_unmapped clean_correct_bsstrand clean_hemifinder clean_pileup clean_klib clean_somatic
make -C $(LSAM0119D) clean
####### archived #######
.PHONY: correct_bsstrand
correct_bsstrand : bin/correct_bsstrand
bin/correct_bsstrand: $(LSAM0119)
gcc $(CFLAGS) -o $@ -I$(INCLUDE) -I$(LSAM0119D) src/correct_bsstrand/correct_bsstrand.c $(LSAM0119) -lz -lpthread
clean_correct_bsstrand:
rm -f bin/correct_bsstrand
# get unmapped reads from bam
.PHONY: get_unmapped
get_unmapped : bin/get_unmapped
bin/get_unmapped : $(LSAM0119)
gcc $(CFLAGS) -o $@ -I$(LSAM0119D) src/get_unmapped/get_unmapped.c $(LSAM0119) -lz -lpthread
clean_get_unmapped:
rm -f bin/get_unmapped
# get trinuc spectrum
.PHONY: sample_trinuc
sample_trinuc : bin/sample_trinuc
bin/sample_trinuc: $(LSAM0119) src/sample_trinuc/sample_trinuc.c
gcc $(CFLAGS) -o $@ -I$(LSAM0119D) -I$(INCLUDE) src/sample_trinuc/sample_trinuc.c -lpthread $(LSAM0119) $(LUTILS) -lz
clean_sample_trinuc:
rm -f bin/sample_trinuc
# find hemi methylation
.PHONY: hemifinder
hemifinder : bin/hemifinder
bin/hemifinder: $(LSAM0119) $(LUTILS) src/hemifinder/hemifinder.c
gcc $(CFLAGS) -o $@ -I$(LSAM0119D) -I$(INCLUDE) src/hemifinder/hemifinder.c $(LSAM0119) $(LUTILS) -lpthread -lz
clean_hemifinder:
rm -f bin/hemifinder