-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.in
287 lines (240 loc) · 9.98 KB
/
Makefile.in
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
# -*- indent-tabs:t; dont-indent:t -*-
# ASGL an abstract argumentation solver in ECL and GECODE.
# Copyright (C) 2015 Kilian Sprotte
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
all: install-asgl
test: test-asgl check
space_objects = BoolSpace.o PrBABSpace.o IntSpace.o
space_object_strings = "BoolSpace.o" "PrBABSpace.o" "IntSpace.o"
lingeling_object = lingeling/code/liblgl.a
lingeling_object_string = "lingeling/code/liblgl.a"
gecode_lib_link_strings = "-lgecodesearch" "-lgecodeminimodel" "-lgecodeint" \
"-lgecodeset" "-lgecodekernel" "-lgecodesupport" \#+gist"-lgecodegist"
asgl_config_fas = common/asgl-config/asgl-config.fas
early_fas = common/early/early.fas
alexandria_fas = lib/alexandria/alexandria.fas
arnesi_list_match_fas = lib/arnesi-list-match/arnesi-list-match.fas
myam_fas = lib/myam/myam.fas
# ref
install-ref:
rm -f bin/asgl
cp support/ref-wrapper.sh bin/asgl
chmod +x bin/asgl
test-ref: install-ref data/iccma15_solutions data/iccma15_testcases
bundle exec cucumber --tags ~@notref --tags ~@slow ${CUKE_ARGS}
# gecode
gecode.fas: gecode.o $(space_objects) $(asgl_config_fas)
rm -f $@
ecl -norc \
-load $(asgl_config_fas) \
-eval "(require 'cmp)" \
-eval '(defvar *lisp-files* (list "$<"))' \
-eval '(defvar *ld-flags* (list $(space_object_strings) $(gecode_lib_link_strings)))' \
-eval '(c:build-fasl "$@" :lisp-files *lisp-files* :ld-flags *ld-flags*)' \
-eval '(quit)'
test -f $@
gecode.o: gecode.lisp gecode $(asgl_config_fas) $(early_fas) $(alexandria_fas)
rm -f $@
ecl -norc \
-load $(asgl_config_fas) \
-load $(early_fas) \
-load $(alexandria_fas) \
-load lisp-scripts/compile-file-system-p.lisp \
-eval '(compile-file-system-p "$<" :dynamic-libraries t)'
test -f $@
# af-constraints
af-constraints.fas: af-constraints.o $(asgl_config_fas)
rm -f $@
ecl -norc \
-load $(asgl_config_fas) \
-eval "(require 'cmp)" \
-eval '(defvar *lisp-files* (list "$<"))' \
-eval '(defvar *ld-flags* (list ))' \
-eval '(c:build-fasl "$@" :lisp-files *lisp-files* :ld-flags *ld-flags*)' \
-eval '(quit)'
test -f $@
af-constraints.o: af-constraints.lisp gecode.fas $(asgl_config_fas) $(early_fas) $(alexandria_fas)
rm -f $@
ecl -norc \
-load $(asgl_config_fas) \
-load $(early_fas) \
-load $(alexandria_fas) \
-load gecode.fas \
-load lisp-scripts/compile-file-system-p.lisp \
-eval '(compile-file-system-p "$<" :dynamic-libraries t)'
test -f $@
# sat
sat.fas: sat.o $(lingeling_object) $(asgl_config_fas)
rm -f $@
ecl -norc \
-load $(asgl_config_fas) \
-eval "(require 'cmp)" \
-eval '(defvar *lisp-files* (list "$<"))' \
-eval '(defvar *ld-flags* (list $(lingeling_object_string)))' \
-eval '(c:build-fasl "$@" :lisp-files *lisp-files* :ld-flags *ld-flags*)' \
-eval '(quit)'
test -f $@
sat.o: sat.lisp $(asgl_config_fas) $(early_fas) $(alexandria_fas)
rm -f $@
ecl -norc \
-load $(asgl_config_fas) \
-load $(early_fas) \
-load $(alexandria_fas) \
-load lisp-scripts/compile-file-system-p.lisp \
-eval '(compile-file-system-p "$<" :dynamic-libraries t)'
test -f $@
asgl.o: asgl.lisp gecode.fas sat.fas af-constraints.fas $(asgl_config_fas) $(early_fas) \
$(myam_fas) $(alexandria_fas) $(arnesi_list_match_fas)
rm -f $@
ecl -norc \
-load $(asgl_config_fas) \
-load $(early_fas) \
-load $(alexandria_fas) \
-load $(arnesi_list_match_fas) \
-load $(myam_fas) \
-load gecode.fas \
-load sat.fas \
-load af-constraints.fas \
-load lisp-scripts/compile-file-system-p.lisp \
-eval '(compile-file-system-p "$<" :dynamic-libraries t)'
test -f $@
# asgl
asgl: asgl.o gecode.o sat.o af-constraints.o BoolSpace.o PrBABSpace.o IntSpace.o common/early/libearly.a \
common/asgl-config/libasgl-config.a $(lingeling_object) \
$(asgl_config_fas) lib/myam/libmyam.a lib/alexandria/libalexandria.a \
lib/arnesi-list-match/libarnesi-list-match.a
ecl -norc -eval '(require "cmp")' \
-load $(asgl_config_fas) \
-eval '(c:build-program "asgl" :lisp-files (list "common/asgl-config/libasgl-config.a" "common/early/libearly.a" "lib/alexandria/libalexandria.a" "lib/arnesi-list-match/libarnesi-list-match.a" "lib/myam/libmyam.a" "gecode.o" "sat.o" "af-constraints.o" "asgl.o") :ld-flags (list "common/early/libapxparse.a" $(space_object_strings) $(gecode_lib_link_strings) $(lingeling_object_string)) :epilogue-code '\''(cl-user::main))' \
-eval '(quit)'
BoolSpace.o: BoolSpace.cpp BoolSpace.h asgl_config.h
g++ -O3 -Wall -Werror -fPIC @CXXFLAGS@ -c BoolSpace.cpp -o BoolSpace.o
PrBABSpace.o: PrBABSpace.cpp PrBABSpace.h BoolSpace.h asgl_config.h
g++ -O3 -Wall -Werror -fPIC @CXXFLAGS@ -c PrBABSpace.cpp -o PrBABSpace.o
IntSpace.o: IntSpace.cpp IntSpace.h BoolSpace.h asgl_config.h
g++ -O3 -Wall -Werror -fPIC @CXXFLAGS@ -c IntSpace.cpp -o IntSpace.o
install-asgl: asgl
cp asgl bin/asgl
test-asgl: install-asgl data/iccma15_solutions data/iccma15_testcases
bundle exec cucumber ${CUKE_ARGS}
test-dist: data/iccma15_solutions data/iccma15_testcases
cp user/asgl/bin/asgl bin/asgl
bundle exec cucumber ${CUKE_ARGS}
common/early/ragel_apx_parse.cpp: common/early/ragel_apx_parse.rl
ragel -G2 common/early/ragel_apx_parse.rl -o common/early/ragel_apx_parse.cpp
common/early/count_args.cpp: common/early/count_args.rl
ragel -G2 common/early/count_args.rl -o common/early/count_args.cpp
common/early/libapxparse.a: common/early/ragel_apx_parse.o common/early/slurp.o \
common/early/count_args.o
ar rcs common/early/libapxparse.a common/early/ragel_apx_parse.o common/early/slurp.o \
common/early/count_args.o
common/early/ragel_apx_parse.o: common/early/ragel_apx_parse.cpp common/early/ragel_apx_parse.h
g++ -O3 -Wall -Werror -fPIC @CXXFLAGS@ -c common/early/ragel_apx_parse.cpp -o common/early/ragel_apx_parse.o
common/early/slurp.o: common/early/slurp.cpp common/early/ragel_apx_parse.h
g++ -O3 -Wall -Werror -fPIC @CXXFLAGS@ -c common/early/slurp.cpp -o common/early/slurp.o
common/early/count_args.o: common/early/count_args.cpp common/early/ragel_apx_parse.h
g++ -O3 -Wall -Werror -fPIC @CXXFLAGS@ -c common/early/count_args.cpp -o common/early/count_args.o
# gecode
gecode: support/gecode-patched-headers.tgz
rm -rf gecode
tar xfz support/gecode-patched-headers.tgz
touch gecode
data/iccma15_solutions: data/iccma15_testcases \
data/iccma15_solutions.tar.xz \
data/real-ee-gr-solutions \
support/fixes.sh
rm -rf data/iccma15_solutions
tar xf data/iccma15_solutions.tar.xz
bash support/fixes.sh
touch data/iccma15_solutions
data/iccma15_testcases: data/iccma15_testcases.tar.xz
rm -rf data/iccma15_testcases
tar xf data/iccma15_testcases.tar.xz
touch data/iccma15_testcases
data/real-ee-gr-solutions: data/real-ee-gr-solutions.tar.xz
rm -rf data/real-ee-gr-solutions
tar -C data -xf data/real-ee-gr-solutions.tar.xz
touch data/real-ee-gr-solutions
# clean
clean: lib/arnesi-list-match/clean lib/alexandria/clean lib/myam/clean \
common/early/clean common/asgl-config/clean
rm -f bin/asgl
rm -f asgl asgl.o BoolSpace.o asgl.data asgl.eclh asgl.c PrBABSpace.o IntSpace.o
rm -rf gecode tmp
rm -rf data/iccma15_solutions data/iccma15_testcases data/real-ee-gr-solutions
rm -f cover.data
rm -f TAGS
rm -fr dist build bin/ragel
rm -f common/asgl-config/asgl-config.c common/asgl-config/asgl-config.data \
common/asgl-config/asgl-config.eclh
rm -f asgl_config.h config.log config.status configure
rm -rf autom4te.cache
rm -f ecl-16.1.2.tgz gecode-4.3.3.tar.gz
rm -f Makefile lisp-scripts/compile-file-system-p.lisp
if [ -n "`git clean -nxd`" ]; then git clean -nxd; exit 1; fi
# dist
.PHONY: dist
dist:
make clean | tail
cp Makefile.in Makefile
mkdir -p dist/asgl
git ls-files | xargs -I% install -D % dist/asgl/%
rm -r dist/asgl/bin/libexec
bash scripts/generate-make-mk.sh
find -name make.mk | xargs -I% install -D % dist/asgl/%
make common/early/ragel_apx_parse.cpp
make common/early/count_args.cpp
ls -1 common/early/ragel_apx_parse.cpp common/early/count_args.cpp | \
xargs -I% install -D % dist/asgl/%
make bin/ragel
make build
ls -1 bin/ragel build | xargs -I% install -D % dist/asgl/%
autoconf
install configure dist/asgl/configure
mkdir dist/asgl/third-party
curl --no-progress-bar --retry 10 -o "ecl-16.1.2.tgz" -L \
"https://common-lisp.net/project/ecl/static/files/release/ecl-16.1.2.tgz"
install ecl-16.1.2.tgz dist/asgl/third-party
curl --no-progress-bar --retry 10 -o "gecode-4.3.3.tar.gz" -L \
"https://github.com/Gecode/gecode/archive/release-4.3.3.tar.gz"
install gecode-4.3.3.tar.gz dist/asgl/third-party
rm -rf dist/asgl/data
rm -rf dist/asgl/timings dist/asgl/features dist/asgl/tools dist/asgl/travis
rm -f dist/asgl/Gemfile dist/asgl/Gemfile.lock dist/asgl/unused.lisp
echo DIST PREPARED
#(cd dist/asgl && ./build )
( cd dist && tar -czf asgl.tar.gz asgl/* )
du -h dist/asgl.tar.gz
bin/ragel:
echo '#!/bin/sh' >>bin/ragel
echo 'echo Ragel SHOULD NOT BE CALLED' >>bin/ragel
echo 'echo Ragel files were pre-compiled for the dist,' >>bin/ragel
echo 'echo so Ragel should not be needed.' >>bin/ragel
echo 'exit 1' >>bin/ragel
chmod +x bin/ragel
build: support/build
cp support/build build
chmod +x build
check:
timeout 5s ./bin/asgl
timeout 1h ./bin/asgl --check
common/asgl-config/asgl-config.o: asgl_config.h
$(lingeling_object):
cd lingeling && ./build.sh
README.pdf: README.md
pandoc README.md -V links-as-notes=true -o README.pdf
doc: README.pdf
include common/asgl-config/make.mk
include common/early/make.mk
include lib/myam/make.mk
include lib/alexandria/make.mk
include lib/arnesi-list-match/make.mk