-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
112 lines (90 loc) · 2.94 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
WALL = -Wall -Werror
FLAGS = $(WALL) -g -DDO_DEBUG -D_FILE_OFFSET_BITS=64 -std=c++0x
# PROF_DIR = PROF <= GCC Bug 47793: relative path turns into absolute
PROF_DIR =
FLAGS_FAST= -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -msse3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
FLAGS_OPT = $(WALL) $(PROF_DIR) $(FLAGS_FAST) -fprofile-use
FLAGS_PROF= $(WALL) $(PROF_DIR) $(FLAGS_FAST) -fprofile-generate
FLAGS_OPT2 = $(WALL) $(PROF_DIR) $(FLAGS_FAST)
SAMPLE_DIR=samples
TEST_FILES = $(wildcard $(SAMPLE_DIR)/*.fq)
all: slimfastq
opt: slimfastq.opt
prof-opt.run:
for l in 1 2 3; do\
for f in $(TEST_FILES) ; do \
echo $$f ... ; \
./slimfastq.prof -f /tmp/mytst -u $$f -O -P -l $$l ; \
./slimfastq.prof -f /tmp/mytst -u /tmp/mytst.copy -O -d ; \
done ; \
done
prof-opt: slimfastq.prof
make prof-opt.run
make opt
make profclean
# find . -name '*.gcda' -delete
profclean:
mkdir -p PROF
find PROF -name '*.gcda' -delete
mv *.gcda PROF/ || true
rm *.prof || true
clean: profclean
find . -name '*.o' -delete
rm slimfastq slimfastq.* || true
gdb: slimfastq.gdb
SOURCES= $(filter-out utest.cpp one.cpp molder.cpp, $(shell ls *.cpp))
HEADERS= $(shell echo *.hpp)
slimfastq.gdb: $(SOURCES) $(HEADERS)
g++ $(FLAGS) -o $@ $(SOURCES)
.PHONY: slimfastq slimfastq.gdb
slimfastq:
g++ $(FLAGS_OPT2) -o $@ $(SOURCES)
@ echo "Done."
slimfastq.opt:
mv PROF/*.gcda . || true
g++ $(FLAGS_OPT) -o $@ $(SOURCES)
mv *.gcda PROF || true
slimfastq.prof:
g++ $(FLAGS_PROF) -o $@ $(SOURCES)
prof:
g++ -O3 -fstrict-aliasing -ffast-math -pg -o slimfastq.prof $(SOURCES)
molder: molder.cpp pager.cpp pager.hpp
g++ $(FLAGS) molder.cpp pager.cpp -o $@
tags:
etags $(SOURCES) $(HEADERS)
UTSRC= $(filter-out one.cpp molder.cpp main.cpp, $(shell ls *.cpp))
UTHDR= $(shell ls *.hpp)
slimfastq.utest: $(UTSRC) $(UTHDR)
g++ $(FLAGS) $(UTSRC) -o $@
utest: slimfastq.utest
./slimfastq.utest
# small: all
# ./slimfastq -f ../data/small.fq -u ../data/small.fq -O
# ./slimfastq -f ../data/small.fq -u ../data/small.fq.tst -O -d
# ../data/mydiff.pl ../data/small.fq ../data/small.fq.tst
# time: prof-opt
# time ./slimfastq.opt -f ../data/t -u ../data/s.fastq -O
# time ./slimfastq.opt -f ../data/t -u ../data/s.fastq.tst -O -d
# cmp ../data/s.fastq ../data/s.fastq.tst
test: all
for l in 1 2 3 4; do \
for f in $(TEST_FILES) ; do \
echo $$f $$l... ; \
rm /tmp/mytst.* || true; \
./slimfastq -u $$f -f /tmp/mytst -O -l $$l -q && \
./slimfastq -u /tmp/mytst.fastq -f /tmp/mytst -O -d && \
tools/mydiff.pl $$f /tmp/mytst.fastq || break ; \
done || break ; \
done
tost: all
for l in 1 ; do \
for f in $(TEST_FILES) ; do \
echo $$f $$l... ; \
rm /tmp/mytst.* || true; \
./slimfastq -u $$f -f /tmp/mytst -O -l $$l -q && \
./slimfastq -u /tmp/mytst.fastq -f /tmp/mytst -O -d && \
tools/mydiff.pl $$f /tmp/mytst.fastq || break ; \
done || break ; \
done
playground:
@ echo $(filter-out molder.cpp, $(shell echo *.cpp))