-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
299 lines (240 loc) · 8.74 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
## @author Manuel Gieseking
# the folders of all submodules. This is used for all the pull, commit, merge, etc. commands of git
DEPENDENCIES_FOLDERS="libs,framework,logics,modelchecker,examples,synthesizer,boundedSynthesis,synthesisDistrEnv,high-level,server-command-line-protocol,server-command-line,webinterface-backend,ui,adammc,adamsynt"
# if you only want to consider a subset of the submodules for pulling (e.g., stay on another branch). Used by pull_subset.
DEPENDENCIES_SUBSET=""
# the build target
FRAMEWORK_TARGETS = tools petrinetwithtransits
MODELCHECKING_TARGETS = logics mc
SYNTHESIZER_TARGETS = petrigames symbolic bounded distrEnv highlevel
UI_TARGETS = protocol server ui adammc adamsynt adam
t=javac
# should be executed no matter if a file with the same name exists or not
.PHONY: tools
.PHONY: petrinetwithtransits
.PHONY: framework
.PHONY: logics
.PHONY: mc
.PHONY: petrigames
.PHONY: bounded
.PHONY: symbolic
.PHONY: bdd
.PHONY: mtbdd
.PHONY: synthesizer
.PHONY: distrEnv
.PHONY: highlevel
.PHONY: backend
.PHONY: server
.PHONY: ui
.PHONY: adammc
.PHONY: adamsynt
.PHONY: adam
.PHONY: backend_deploy
.PHONY: mc_deploy_noUI
.PHONY: synt_deploy_noUI
.PHONY: bounded_deploy_noUI
#.PHONY: javadoc
.PHONY: setJavac
.PHONY: setJar
.PHONY: setDeploy
.PHONY: setDeployMC
.PHONY: setDeploySynt
.PHONY: setDeployBounded
.PHONY: setStandalone
.PHONY: setClean
.PHONY: setCleanAll
.PHONY: examples
# git targets
.PHONY: status_all
.PHONY: checkout_branch_all
.PHONY: close_branch_all
.PHONY: pull_all
.PHONY: pl
.PHONY: pull_subset
.PHONY: commit_all
.PHONY: co
.PHONY: merge_all
.PHONY: push_all
.PHONY: ph
# functions
create_bashscript = \#!/bin/bash\n\nBASEDIR=\"\044(dirname \044\060)\"\n\nif [ ! -f \"\044BASEDIR/adam$(strip $(1)).jar\" ] ; then\n\techo \"adam$(strip $(1)).jar not found! Run 'ant jar' first!\" >&2\n\texit 127\nfi\n\njava -DPROPERTY_FILE=./ADAM.properties -Dfile.encoding=UTF-8 -jar \"\044BASEDIR/adam$(strip $(1)).jar\" \"\044@\"
define generate_src
mkdir -p adam_src
if [ $(1) = true ]; then\
cp -R ./lib ./adam_src/lib/; \
cp -R --parent ./test/lib ./adam_src/; \
fi
for i in $$(find . -type d \( -path ./benchmarks -o -path ./test/lib -o -path ./lib -o -path ./adam_src \) -prune -o -name '*' -not -regex ".*\(class\|qcir\|pdf\|tex\|apt\|dot\|jar\|ods\|txt\|tar.gz\|aux\|log\|res\|aig\|aag\|lola\|cex\|properties\|json\|xml\|out\|pnml\|so\)" -type f); do \
echo "cp" $$i; \
cp --parent $$i ./adam_src/ ;\
done
tar -zcvf adam_src.tar.gz adam_src
rm -r -f ./adam_src
endef
# targets
all: deploy
######################## git commands for all submodules
status_all:
./status_all.sh $(DEPENDENCIES_FOLDERS)
# branch=<name> specifies the branch which should be checked out. Default: branch=master.
# new=<name> creates a new branch with the name
checkout_branch_all:
./checkout_branch_all.sh
# branch=<name> must be set and specifies the branch which should be closed.
# tag=<tag> can be set to name the tag which is given the closing commit.
#Attention: the branch is deleted and only a tag links to the commit.
close_branch_all:
./close_branch_all.sh $(DEPENDENCIES_FOLDERS)
pull_all:
# the following command leaves the submodule with detached heads. Thus, we use an own script
# git submodule update --remote
# git pull
./pull_all.sh $(DEPENDENCIES_FOLDERS)
pl: pull_all
pull_subset:
./pull_all.sh $(DEPENDENCIES_SUBSET)
# msg="<msg>" must be set to define a commit message.
commit_all:
./commit_all.sh $(DEPENDENCIES_FOLDERS)
# msg="<msg>" must be set to define a commit message.
co: commit_all
# branch=<name> must be set and specifies the branch which should be merged.
merge_all:
./merge_all.sh $(DEPENDENCIES_FOLDERS)
# options="<options>" allows to add options to the git push command, e.g.,
# make push_all options="--set-upstream origin test" to push the first time into a new branch test and link this to remote branch.
push_all:
./push_all.sh $(DEPENDENCIES_FOLDERS)
ph: push_all
# submodules targets
tools:
ant -buildfile ./framework/tools/build.xml $(t)
petrinetwithtransits:
ant -buildfile ./framework/petrinetWithTransits/build.xml $(t)
framework: $(FRAMEWORK_TARGETS)
logics:
ant -buildfile ./logics/build.xml $(t)
mc:
ant -buildfile ./modelchecker/build.xml $(t)
petrigames:
ant -buildfile ./synthesizer/petriGames/build.xml $(t)
bounded:
ant -buildfile ./boundedSynthesis/build.xml $(t)
bdd:
ant -buildfile ./synthesizer/symbolicalgorithms/bddapproach/build.xml $(t)
mtbdd:
ant -buildfile ./synthesizer/symbolicalgorithms/mtbddapproach/build.xml $(t)
symbolic: bdd mtbdd
synthesizer: petrigames symbolic
distrEnv:
ant -buildfile ./synthesisDistrEnv/build.xml $(t)
highlevel:
ant -buildfile ./high-level/build.xml $(t)
backend:
ant -buildfile ./webinterface-backend/build.xml $(t)
protocol:
ant -buildfile ./server-command-line-protocol/build.xml $(t)
server:
ant -buildfile ./server-command-line/build.xml $(t)
ui:
ant -buildfile ./ui/build.xml $(t)
adammc:
ant -buildfile ./adammc/build.xml $(t)
adamsynt:
ant -buildfile ./adamsynt/build.xml $(t)
adam:
ant -buildfile ./adam/build.xml $(t)
setJavac:
$(eval t=javac)
setClean:
$(eval t=clean)
setCleanAll:
$(eval t=clean-all)
setDeploy:
$(eval t=deploy)
setDeployMC:
$(eval t=deploy_mc)
setDeploySynt:
$(eval t=deploy_synth)
setDeployBounded:
$(eval t=deploy_bounded)
setStandalone:
$(eval t=jar-standalone)
javadoc:
ant javadoc
backend_deploy: $(FRAMEWORK_TARGETS) $(MODELCHECKING_TARGETS) $(SYNTHESIZER_TARGETS) setDeploy backend
mkdir -p deploy
cp ./adam_core.jar ./deploy/adam_core.jar
mc_deploy: $(FRAMEWORK_TARGETS) $(MODELCHECKING_TARGETS) ui setDeploy adammc
mkdir -p deploy
echo "$(call create_bashscript, MC)" > ./deploy/adamMC
chmod +x ./deploy/adamMC
cp ./adammc/adam_mc.jar ./deploy/adamMC.jar
cp ./ADAM.properties ./deploy/ADAM.properties
synt_deploy: $(FRAMEWORK_TARGETS) $(SYNTHESIZER_TARGETS) ui protocol setDeploy server adamsynt
mkdir -p deploy
mkdir -p deploy/lib
echo "$(call create_bashscript, SYNT)" > ./deploy/adamSYNT
chmod +x ./deploy/adamSYNT
cp ./adamsynt/adam_synt.jar ./deploy/adamSYNT.jar
cp ./server-command-line/adam_server.jar ./deploy/adam_server.jar
cp ./ADAM.properties ./deploy/ADAM.properties
# cp ./libs/quabs_mac ./deploy/lib/quabs_mac
# cp ./libs/quabs_unix ./deploy/lib/quabs_unix
# cp ./libs/javaBDD/libcudd.so ./deploy/lib/libcudd.so
# cp ./libs/javaBDD/libbuddy.so ./deploy/lib/libbuddy.so
deploy: $(FRAMEWORK_TARGETS) $(MODELCHECKING_TARGETS) $(SYNTHESIZER_TARGETS) ui protocol setDeploy server adamsynt adammc adam
mkdir -p deploy
mkdir -p deploy/lib
echo "$(call create_bashscript)" > ./deploy/adam
chmod +x ./deploy/adam
cp ./adam/adam_adam.jar ./deploy/adam.jar
cp ./server-command-line/adam_server.jar ./deploy/adam_server.jar
cp ./ADAM.properties ./deploy/ADAM.properties
# cp ./libs/quabs_mac ./deploy/lib/quabs_mac
# cp ./libs/quabs_unix ./deploy/lib/quabs_unix
# cp ./libs/javaBDD/libcudd.so ./deploy/lib/libcudd.so
# cp ./libs/javaBDD/libbuddy.so ./deploy/lib/libbuddy.so
# The noUI targets are kind of hacky because they take the core package with the complete Adam and
# tries to filter out unrelated classes.
mc_deploy_noUI: $(FRAMEWORK_TARGETS) $(MODELCHECKING_TARGETS) setDeployMC backend
mkdir -p deploy
echo "$(call create_bashscript, _mc)" > ./deploy/adam_mc
chmod +x ./deploy/adam_mc
cp ./webinterface-backend/adam_mc.jar ./deploy/adam_mc.jar
cp ./ADAM.properties ./deploy/ADAM.properties
synt_deploy_noUI: $(FRAMEWORK_TARGETS) $(SYNTHESIZER_TARGETS) setDeploySynt backend
mkdir -p deploy
mkdir -p deploy/lib
echo "$(call create_bashscript, _synt)" > ./deploy/adam_synt
chmod +x ./deploy/adam_synt
cp ./webinterface-backend/adam_synt.jar ./deploy/adam_synt.jar
cp ./ADAM.properties ./deploy/ADAM.properties
# cp ./libs/quabs_mac ./deploy/lib/quabs_mac
# cp ./libs/quabs_unix ./deploy/lib/quabs_unix
# cp ./libs/javaBDD/libcudd.so ./deploy/lib/libcudd.so
# cp ./libs/javaBDD/libbuddy.so ./deploy/lib/libbuddy.so
bounded_deploy_noUI: $(FRAMEWORK_TARGETS) petrigames bounded setDeployBounded backend
mkdir -p deploy
echo "$(call create_bashscript, _bounded)" > ./deploy/adam_bounded
chmod +x ./deploy/adam_bounded
cp ./webinterface-backend/adam_bounded.jar ./deploy/adam_bounded.jar
cp ./ADAM.properties ./deploy/ADAM.properties
clean: setClean $(FRAMEWORK_TARGETS) $(MODELCHECKING_TARGETS) $(SYNTHESIZER_TARGETS) $(UI_TARGETS)
rm -r -f deploy
rm -r -f javadoc
clean-all: setCleanAll $(FRAMEWORK_TARGETS) $(MODELCHECKING_TARGETS) $(SYNTHESIZER_TARGETS) $(UI_TARGETS)
rm -r -f deploy
rm -r -f javadoc
src_withlibs: clean-all
$(call generate_src, true)
src: clean-all
$(call generate_src, false)
examples:
mkdir -p examples_tmp
for i in $$(find ./examples -regex '.*\.\(apt\|${withSuff}\)' ); do \
echo "cp" $$i; \
cp --parent $$i ./examples_tmp/ ;\
done
tar -zcf adam_examples.tar.gz examples_tmp/examples
rm -r -f ./examples_tmp