-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
123 lines (93 loc) · 3.62 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
# Create "make test"
.PHONY: test clean build
BIN=./bin
SCRIPTS=./scripts
SOURCE=./src
DATA=./data
CC=gcc
CFLAGS=-O3
CXX=g++
CXXFLAGS=-std=c++11 -O3
LDLIBS=-lz
VERSION := $(shell grep version seqfu.nimble | grep -o "[0-9]\\+\.[0-9]\\+\.[0-9]\\+")
NIMPARAM := --mm:orc -d:NimblePkgVersion=$(VERSION) -d:release --opt:speed --passC:"-Wno-error=incompatible-pointer-types"
TARGETS=$(BIN)/seqfu $(BIN)/fu-msa $(BIN)/fu-primers $(BIN)/dadaist2-mergeseqs $(BIN)/fu-shred $(BIN)/fu-homocomp $(BIN)/fu-multirelabel $(BIN)/fu-index $(BIN)/fu-cov $(BIN)/fu-16Sregion $(BIN)/fu-nanotags $(BIN)/fu-orf $(BIN)/fu-sw $(BIN)/fu-virfilter $(BIN)/fu-tabcheck $(BIN)/byteshift $(BIN)/SeqCountHelper $(BIN)/fu-secheck
PYTARGETS=$(BIN)/fu-split $(BIN)/fu-pecheck $(BIN)/fu-readtope
all: $(TARGETS) $(PYTARGETS)
sources/: src/sfu.nim s
mkdir -p sources
nim c --cc:$(CC) $(NIMPARAM) --nimcache:sources/ --genScript ./src/sfu.nim
bash test/convert.sh sources/compile_sfu.sh
src/deps.txt:
nimble install -y --depsOnly
touch $@
src/sfu.nim: ./src/fast*.nim ./src/*utils*.nim src/deps.txt seqfu.nimble
touch $@
$(BIN)/byteshift: test/byte/shifter.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
$(BIN)/fu-secheck: test/byte/validate.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
$(BIN)/SeqCountHelper: test/byte/count.cpp
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
$(BIN)/fu-split: $(SCRIPTS)/fu-split
chmod +x $(SCRIPTS)/fu-split
cp -f $(SCRIPTS)/fu-split $(BIN)/fu-split
sed '2 s/^/### DO NOT EDIT THIS SCRIPT!\n/' $(SCRIPTS)/fu-split > $(BIN)/fu-split
chmod 555 $(BIN)/fu-split
$(BIN)/fu-pecheck: $(SCRIPTS)/fu-pecheck
chmod +x $(SCRIPTS)/fu-pecheck
cp -f $(SCRIPTS)/fu-pecheck $(BIN)/fu-pecheck
sed '2 s/^/### DO NOT EDIT THIS SCRIPT!\n/' $(SCRIPTS)/fu-pecheck > $(BIN)/fu-pecheck
chmod 555 $(BIN)/fu-pecheck
$(BIN)/fu-readtope: $(SCRIPTS)/fu-readtope
chmod +x $(SCRIPTS)/fu-readtope
cp -f $(SCRIPTS)/fu-readtope $(BIN)/fu-readtope
sed '2 s/^/### DO NOT EDIT THIS SCRIPT!\n/' $(SCRIPTS)/fu-readtope > $(BIN)/fu-readtope
chmod 555 $(BIN)/fu-readtope
$(BIN)/seqfu: src/sfu.nim
nim c $(NIMPARAM) --out:$@ $<
$(BIN)/fu-primers: src/fu_primers.nim
nim c --threads:on $(NIMPARAM) --out:$@ $<
$(BIN)/fu-shred: src/fu_shred.nim
nim c $(NIMPARAM) --out:$@ $<
$(BIN)/fu-nanotags: src/fu_nanotags.nim
nim c --threads:on $(NIMPARAM) --out:$@ $<
$(BIN)/fu-orf: src/fu_orf.nim
nim c --threads:on $(NIMPARAM) --out:$@ $<
$(BIN)/fu-sw: src/fu_sw.nim
nim c --threads:on $(NIMPARAM) --out:$@ $<
$(BIN)/fu-homocomp: src/fu_homocomp.nim
nim c --threads:on $(NIMPARAM) --out:$@ $<
$(BIN)/fu-multirelabel: src/fu_multirelabel.nim
nim c $(NIMPARAM) --out:$@ $<
$(BIN)/fu-index: src/fu_index.nim
nim c $(NIMPARAM) --out:$@ $<
$(BIN)/fu-cov: src/fu_cov.nim
nim c $(NIMPARAM) --out:$@ $<
$(BIN)/fu-msa: src/fu_msa.nim
nim c $(NIMPARAM) --out:$@ $<
$(BIN)/fu-virfilter: src/fu_virfilter.nim
nim c $(NIMPARAM) --out:$@ $<
$(BIN)/fu-tabcheck: src/fu_tabcheck.nim
nim c $(NIMPARAM) --out:$@ $<
$(BIN)/fu-16Sregion: src/dadaist2_region.nim
nim c --threads:on $(NIMPARAM) --out:$@ $<
$(BIN)/dadaist2-mergeseqs: src/dadaist2_mergeseqs.nim
nim c $(NIMPARAM) --out:$@ $<
multiqc: $(BIN)/seqfu
mkdir -p temp-mqc
$(BIN)/seqfu stats $(DATA)/filt.fa.gz $(DATA)/orf.fa.gz --multiqc temp-mqc/stats_mqc.txt
$(BIN)/seqfu count-legacy $(DATA)/filt.fa.gz $(DATA)/orf.fa.gz --multiqc temp-mqc/counts_mqc.txt
multiqc -f -o multiqc/ temp-mqc
rm -rf temp-mqc
open "multiqc/multiqc_report.html"
build:
nimble build
test: all
bash ./test/mini.sh
clean:
@echo "Cleaning..."
@for i in $(TARGETS); \
do \
if [ -e "$$i" ]; then rm -f $$i; echo "Removing $$i"; else echo "$$i Not found"; fi \
done