-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmakefile
146 lines (131 loc) · 6.88 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
PREFIX=/usr
TESTPREFIX=/home/sjanssen/Desktop/fold-grammars/Misc/Test-Suite/StefanStyle/
#programs
GAPC=gapc
MAKE=make
PERL=perl
PYTHON=python
INSTALL=install
SED=sed
CC=gcc
RSYNC=rsync
BASH=bash
#system dependend tools
TMPDIR := $(shell mktemp -d)
PWD := $(shell pwd)
ARCHTRIPLE := $(shell $(CC) -dumpmachine)
#fold-grammars specific variables
grammars=nodangle overdangle microstate macrostate
levels=5 4 3 2 1
isEval=0
RNAOPTIONSPERLSCRIPT=/Misc/Applications/addRNAoptions.pl
#compile options
CXXFLAGS_EXTRA=-O3 -DNDEBUG
FASTLIBRNA=
WINDOWSUFFIX=_window
window=
EXTRARUNTIMEPATHS=
ifdef window
windowmodeflag=--window-mode
current_windowmodesuffix=$(WINDOWSUFFIX)
else
windowmodeflag=
current_windowmodesuffix=
endif
dummy:
@if [ "$(BASEDIR)" = "" ]; then \
echo "To build all programs of the fold-grammars suite, type 'make build-suite' and 'make install-suite'!"; \
else \
echo "If you wan't to compile just one program from the fold-grammars suite, type 'make all' instead of 'make'!"; \
fi;
build-suite:
$(MAKE) -C Misc/Applications/pKiss all
$(MAKE) -C Misc/Applications/pAliKiss all
$(MAKE) -C Misc/Applications/RNAshapes all
$(MAKE) -C Misc/Applications/RNAalishapes all
$(MAKE) -C Misc/Applications/Knotinframe all
$(MAKE) -C Misc/Applications/RapidShapes all
$(MAKE) -C Misc/Applications/aCMs all
$(MAKE) -C Misc/Applications/RNAcofold all
$(MAKE) -C Misc/Applications/RNAhybrid all
install-suite:
$(MAKE) -C Misc/Applications/lib install
$(MAKE) -C Misc/Applications/Knotinframe install-program
$(MAKE) -C Misc/Applications/pKiss install-program
$(MAKE) -C Misc/Applications/pAliKiss install-program
$(MAKE) -C Misc/Applications/RapidShapes install-program
$(MAKE) -C Misc/Applications/RNAalishapes install-program
$(MAKE) -C Misc/Applications/RNAshapes install-program
$(MAKE) -C Misc/Applications/Locomotif_wrapper install-program
$(MAKE) -C Misc/Applications/aCMs install-program
$(MAKE) -C Misc/Applications/RNAcofold install-program
$(MAKE) -C Misc/Applications/RNAhybrid install-program
distclean-suite:
$(MAKE) -C Misc/Applications/Knotinframe distclean
$(MAKE) -C Misc/Applications/pKiss distclean
$(MAKE) -C Misc/Applications/pAliKiss distclean
$(MAKE) -C Misc/Applications/RapidShapes distclean
$(MAKE) -C Misc/Applications/RNAalishapes distclean
$(MAKE) -C Misc/Applications/RNAshapes distclean
$(MAKE) -C Misc/Applications/aCMs distclean
$(MAKE) -C Misc/Applications/RNAcofold distclean
$(MAKE) -C Misc/Applications/RNAhybrid distclean
install-lib:
$(MAKE) -C $(BASEDIR)/Misc/Applications/lib/ install
test-suite:
if [ ! -d "$(TESTPREFIX)/$(ARCHTRIPLE)/$(ARCHTRIPLE)/bin" ]; then $(INSTALL) -d $(TESTPREFIX)/$(ARCHTRIPLE)/$(ARCHTRIPLE)/bin; fi;
$(MAKE) -C Misc/Applications/Knotinframe install-program PREFIX=$(TESTPREFIX)/$(ARCHTRIPLE)/$(ARCHTRIPLE)
$(MAKE) -C Misc/Applications/pKiss install-program PREFIX=$(TESTPREFIX)/$(ARCHTRIPLE)/$(ARCHTRIPLE)
$(MAKE) -C Misc/Applications/pAliKiss install-program PREFIX=$(TESTPREFIX)/$(ARCHTRIPLE)/$(ARCHTRIPLE)
$(MAKE) -C Misc/Applications/RapidShapes install-program PREFIX=$(TESTPREFIX)/$(ARCHTRIPLE)/$(ARCHTRIPLE)
$(MAKE) -C Misc/Applications/RNAalishapes install-program PREFIX=$(TESTPREFIX)/$(ARCHTRIPLE)/$(ARCHTRIPLE)
$(MAKE) -C Misc/Applications/RNAshapes install-program PREFIX=$(TESTPREFIX)/$(ARCHTRIPLE)/$(ARCHTRIPLE)
mv $(TESTPREFIX)/$(ARCHTRIPLE)/$(ARCHTRIPLE)/bin/* $(TESTPREFIX)/$(ARCHTRIPLE)/$(ARCHTRIPLE)
compile:
if [ ! -f "$(ARCHTRIPLE)/$(PROGRAMPREFIX)$(gapc_binaryname)" ]; then \
cd $(TMPDIR) && $(GAPC) -I $(PWD)/$(BASEDIR) -p "$(gapc_product)" $(gapc_options) $(PWD)/$(BASEDIR)/$(gapc_file); \
$(PERL) $(PWD)/$(BASEDIR)/$(RNAOPTIONSPERLSCRIPT) $(TMPDIR)/out.mf $(isEval) '$(gapc_binaryname)' '$(gapc_product)'; \
cd $(TMPDIR) && $(MAKE) -f out.mf CPPFLAGS_EXTRA="-I $(PWD)/$(BASEDIR) -I ./" CXXFLAGS_EXTRA="$(CXXFLAGS_EXTRA)" $(FASTLIBRNA) LDFLAGS_EXTRA="$(EXTRARUNTIMEPATHS)"; \
$(INSTALL) -d $(PWD)/$(ARCHTRIPLE); \
$(INSTALL) $(TMPDIR)/out $(PWD)/$(ARCHTRIPLE)/$(PROGRAMPREFIX)$(gapc_binaryname); \
fi;
cd $(PWD) && rm -rf $(TMPDIR);
compile_instance:
if [ ! -f "$(ARCHTRIPLE)/$(PROGRAMPREFIX)$(gapc_binaryname)" ]; then \
cd $(TMPDIR) && $(GAPC) -I $(PWD)/$(BASEDIR) -i "$(gapc_instance)" $(gapc_options) $(PWD)/$(BASEDIR)/$(gapc_file); \
$(PERL) $(PWD)/$(BASEDIR)/$(RNAOPTIONSPERLSCRIPT) $(TMPDIR)/out.mf $(isEval) '$(gapc_binaryname)' '$(gapc_product)'; \
cd $(TMPDIR) && $(MAKE) -f out.mf CPPFLAGS_EXTRA="-I $(PWD)/$(BASEDIR) -I ./" CXXFLAGS_EXTRA="$(CXXFLAGS_EXTRA)" $(FASTLIBRNA) LDFLAGS_EXTRA="$(EXTRARUNTIMEPATHS)"; \
$(INSTALL) -d $(PWD)/$(ARCHTRIPLE); \
$(INSTALL) $(TMPDIR)/out $(PWD)/$(ARCHTRIPLE)/$(PROGRAMPREFIX)$(gapc_binaryname); \
fi;
cd $(PWD) && rm -rf $(TMPDIR);
compile_mea:
if [ ! -f "$(ARCHTRIPLE)/$(PROGRAMPREFIX)$(gapc_binaryname)" ]; then \
cd $(TMPDIR) && $(GAPC) -I $(PWD)/$(BASEDIR) -p "$(gapc_product1)" $(gapc_options1) $(PWD)/$(BASEDIR)/$(gapc_file1) -o bppm.cc; \
cd $(TMPDIR) && $(SED) -i 's|void cyk();|STOREPROBS;\n void cyk();|' bppm.hh; \
cd $(TMPDIR) && $(SED) -i "s/namespace gapc {/namespace outside_gapc {/" bppm.hh; \
cd $(TMPDIR) && $(SED) -i "s/^#define OUTSIDE//" bppm.hh; \
cd $(TMPDIR) && $(GAPC) -I $(PWD)/$(BASEDIR) -p "$(gapc_product2)" $(gapc_options2) $(PWD)/$(BASEDIR)/$(gapc_file2); \
$(PERL) $(PWD)/$(BASEDIR)/$(RNAOPTIONSPERLSCRIPT) $(TMPDIR)/out.mf 2 '$(gapc_binaryname)' '$(gapc_product)'; \
cd $(TMPDIR) && $(MAKE) -f out.mf bppm.o CPPFLAGS_EXTRA="-I $(PWD)/$(BASEDIR) -I ./" CXXFLAGS_EXTRA="$(CXXFLAGS_EXTRA)" $(FASTLIBRNA) LDFLAGS_EXTRA="$(EXTRARUNTIMEPATHS)"; \
cd $(TMPDIR) && $(MAKE) -f out.mf CPPFLAGS_EXTRA="-I $(PWD)/$(BASEDIR) -I ./" CXXFLAGS_EXTRA="$(CXXFLAGS_EXTRA)" $(FASTLIBRNA) LDFLAGS_EXTRA="bppm.o $(EXTRARUNTIMEPATHS)"; \
$(INSTALL) -d $(PWD)/$(ARCHTRIPLE); \
$(INSTALL) $(TMPDIR)/out $(PWD)/$(ARCHTRIPLE)/$(PROGRAMPREFIX)$(gapc_binaryname); \
fi;
cd $(PWD) && rm -rf $(TMPDIR);
compile_local:
if [ ! -f "$(ARCHTRIPLE)/$(PROGRAMPREFIX)$(gapc_binaryname)" ]; then \
cd $(TMPDIR) && ln -s $(PWD)/$(BASEDIR)/$(gapc_file) .; \
mkdir -p $(TMPDIR)/Grammars; \
cat $(PWD)/$(BASEDIR)/Grammars/$(GRAMMARFILE) | sed "s|axiom = struct|axiom = local|" > $(TMPDIR)/Grammars/gra_pknot_microstate.gap; \
cd $(TMPDIR) && $(GAPC) -I $(PWD)/$(BASEDIR) -p "$(gapc_product)" $(gapc_options) $(PWD)/$(BASEDIR)/$(gapc_file); \
$(PERL) $(PWD)/$(BASEDIR)/$(RNAOPTIONSPERLSCRIPT) $(TMPDIR)/out.mf $(isEval) '$(gapc_binaryname)' '$(gapc_product)'; \
cd $(TMPDIR) && $(MAKE) -f out.mf CPPFLAGS_EXTRA="-I $(PWD)/$(BASEDIR) -I ./" CXXFLAGS_EXTRA="$(CXXFLAGS_EXTRA)" $(FASTLIBRNA) LDFLAGS_EXTRA="$(EXTRARUNTIMEPATHS)"; \
$(INSTALL) -d $(PWD)/$(ARCHTRIPLE); \
$(INSTALL) $(TMPDIR)/out $(PWD)/$(ARCHTRIPLE)/$(PROGRAMPREFIX)$(gapc_binaryname); \
fi;
cd $(PWD) && rm -rf $(TMPDIR);
test: build-suite
cd Misc/Test-Suite/GeorgStyle/ && $(BASH) run.sh ../Truth
cd Misc/Test-Suite/StefanStyle/ && $(PERL) runTests.pl
cd Misc/Test-Suite/StefanStyle/ && $(PYTHON) test_cofold.py