forked from BGI-Qingdao/TGS-GapCloser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenMake.sh
executable file
·112 lines (83 loc) · 1.84 KB
/
GenMake.sh
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
#!/bin/bash
scripts="\
"
apps="\
TGSGapCloser\
TGSGapCandidate\
TGSSeqSplit\
TGSSeqGen\
"
jobs_o=" "
function GenApp()
{
local AppName=$1
jobs_o="$jobs_o \${$AppName""_o}"
echo """
$AppName"_cpp = "$AppName".cpp"
$AppName"_o = "$AppName".o"
$AppName" : clean \${"$AppName"_o} \${source_o} ../bin"
\${CXX} \${$AppName"_o} \${source_o} \${LD_FLAGS} \${DEUBG_CXX} -o "$AppName
mv \$@ ../bin/
""">>Makefile
}
function GenScript()
{
local SS=$1
echo """
$SS:
cp $SS ../bin/
""">>Makefile
}
echo ".PHONY: all clean bin ${scripts}" >Makefile
echo """
CC = gcc
CXX = g++
CXXFLAGS = -std=c++11\\
-I../\\
LD_FLAGS = -L../minimap2\\
-lz\\
-lminimap2\\
-lpthread\\
DEUBG_CXX = \${CXXFLAGS} -g
RELEASE_CXX= \${CXXFLAGS}
source_cpp = ../common/files/file_reader.cpp \\
../biocommon/sam_bam/sam_parser.cpp\\
../biocommon/pair/pair_sam_parser.cpp\\
../biocommon/fasta/fasta.cpp\\
../biocommon/fastq/fastq.cpp\\
../biocommon/seq/seq.cpp\\
../biocommon/paf/PAF.cpp\\
../biocommon/align_common/align_result.cpp\\
../common/files/file_writer.cpp \\
../common/files/gzstream.cpp \\
../common/log/log.cpp\\
../common/log/logfilter.cpp\\
../common/time/timetools.cpp\\
../common/string/stringtools.cpp\\
../appcommon/contigPairInfo.cpp\\
../appcommon/ScaffInfo.cpp\\
../appcommon/ONT2Gap.cpp\\
../common/args/argsparser.cpp\\
source_o = \${source_cpp:%.cpp=%.o}
.cpp.o:
\${CXX} \${DEUBG_CXX} -c \$< -o \$@
jobs =$apps
scripts=$scripts
all : \${jobs} \${scripts}
""" >>Makefile
for x in $scripts
do
GenScript $x
done
for x in $apps
do
GenApp $x
done
echo "jobs_o=$jobs_o">>Makefile
echo """
dirty =\${jobs_o} \${jobs} \${source_o}
../bin:
mkdir -p ../bin
clean:
rm -rf \${dirty}
""" >>Makefile