2 # Copyright 2012-2023 Free Software Foundation, Inc.
4 # This file is part of GNU lightning.
6 # GNU lightning is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU Lesser General Public License as published
8 # by the Free Software Foundation; either version 3, or (at your option)
11 # GNU lightning is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 # License for more details.
17 AM_CFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \
18 -D_GNU_SOURCE $(LIGHTNING_CFLAGS)
20 check_PROGRAMS = lightning ccall self setcode nodata ctramp carg cva_list \
21 catomic protect riprel cbit callee
23 lightning_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
24 lightning_SOURCES = lightning.c
26 ccall_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
27 ccall_SOURCES = ccall.c
29 self_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
32 setcode_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
33 setcode_SOURCES = setcode.c
35 nodata_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
36 nodata_SOURCES = nodata.c
38 ctramp_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
39 ctramp_SOURCES = ctramp.c
41 carg_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
44 cva_list_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
45 cva_list_SOURCES = cva_list.c
47 catomic_LDADD = $(top_builddir)/lib/liblightning.la -lm -lpthread $(SHLIB)
48 catomic_SOURCES = catomic.c
50 protect_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
51 protect_SOURCES = protect.c
53 riprel_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
54 riprel_SOURCES = riprel.c
56 # Actually, gcc 4.1.2 does not like unknown -Wno-option and errors out;
57 # better to just have warnings.
59 cbit_CFLAGS = $(AM_CFLAGS) -fwrapv
61 cbit_CFLAGS = $(AM_CFLAGS) -fwrapv -Wno-overflow -Wno-integer-overflow \
62 -Wno-shift-count-overflow
64 cbit_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
67 callee_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
68 callee_SOURCES = callee.c
70 noinst_PROGRAMS = gen_cbit
71 gen_cbit_SOURCES = gen_cbit.c
74 $(top_builddir)/check/gen_cbit > cbit.c
76 $(top_builddir)/lib/liblightning.la:
77 cd $(top_builddir)/lib; $(MAKE) $(AM_MAKEFLAGS) liblightning.la
83 allocai.tst allocai.ok \
84 allocar.tst allocar.ok \
92 ldstxr.tst ldstxr.ok \
93 ldstxi.tst ldstxi.ok \
94 ldstr-c.tst ldstr-c.ok \
95 ldstxr-c.tst ldstxr-c.ok \
96 ldstxi-c.tst ldstxi-c.ok \
101 branch.tst branch.ok \
103 alu_add.tst alu_add.ok \
104 alux_add.tst alux_add.ok \
105 alu_sub.tst alu_sub.ok \
106 alux_sub.tst alux_sub.ok \
107 alu_rsb.tst alu_rsb.ok \
108 alu_mul.tst alu_mul.ok \
109 alu_hmul.tst alu_hmul.ok \
110 alu_div.tst alu_div.ok \
111 alu_rem.tst alu_rem.ok \
112 alu_and.tst alu_and.ok \
113 alu_or.tst alu_or.ok \
114 alu_xor.tst alu_xor.ok \
115 alu_lsh.tst alu_lsh.ok \
116 alu_rsh.tst alu_rsh.ok \
117 alu_com.tst alu_com.ok \
118 alu_neg.tst alu_neg.ok \
119 alu_rot.tst alu_rot.ok \
121 fop_abs.tst fop_abs.ok \
122 fop_sqrt.tst fop_sqrt.ok \
123 varargs.tst varargs.ok \
125 clobber.tst clobber.ok \
134 qalu_mul.tst qalu_mul.ok \
135 qalu_div.tst qalu_div.ok \
136 qalu_shift.tst qalu_shift.ok \
138 ranger.tst ranger.ok \
142 va_list.tst va_list.ok \
145 popcnt.tst popcnt.ok \
147 unldst.tst unldst.ok \
150 check.arm.sh check.swf.sh \
154 check.x87.nodata.sh \
156 collatz.tst factorial.tst \
160 3to2 add align allocai \
161 allocar bp divi fib rpn \
164 ldstr-c ldstxr-c ldstxi-c \
165 ext cvt hton bswap branch \
167 alu_sub alux_sub alu_rsb \
170 alu_and alu_or alu_xor \
172 alu_com alu_neg alu_rot \
177 float jmpr live put \
178 qalu_mul qalu_div qalu_shift \
179 range ranger ret skip tramp \
180 va_list bit rbit popcnt imm \
183 $(base_TESTS): check.sh
184 $(LN_S) $(srcdir)/check.sh $@
186 TESTS = $(base_TESTS)
189 #x87_TESTS = $(addsuffix .x87, $(base_TESTS))
191 3to2.x87 add.x87 allocai.x87 \
192 allocar.x87 bp.x87 divi.x87 fib.x87 \
193 rpn.x87 ldstr.x87 ldsti.x87 \
194 ldstxr.x87 ldstxi.x87 \
195 ldstr-c.x87 ldstxr-c.x87 ldstxi-c.x87 \
196 ext.x87 cvt.x87 branch.x87 \
197 alu_add.x87 alux_add.x87 \
198 alu_sub.x87 alux_sub.x87 alu_rsb.x87 \
199 alu_mul.x87 alu_hmul.x87 \
200 alu_div.x87 alu_rem.x87 \
201 alu_and.x87 alu_or.x87 alu_xor.x87 \
202 alu_lsh.x87 alu_rsh.x87 alu_rot.x87 \
203 alu_com.x87 alu_neg.x87 \
205 fop_abs.x87 fop_sqrt.x87 \
206 varargs.x87 stack.x87 \
207 clobber.x87 carry.x87 call.x87 \
208 float.x87 jmpr.x87 put.x87 \
209 va_list.x87 imm.x87 unldst.x87
210 $(x87_TESTS): check.x87.sh
211 $(LN_S) $(srcdir)/check.x87.sh $@
212 TESTS += $(x87_TESTS)
214 #x87_nodata_TESTS = $(addsuffix .x87.nodata, $(base_TESTS))
216 3to2.x87.nodata add.x87.nodata allocai.x87.nodata \
217 allocar.x87.nodata bp.x87.nodata divi.x87.nodata fib.x87.nodata \
218 rpn.x87.nodata ldstr.x87.nodata ldsti.x87.nodata \
219 ldstxr.x87.nodata ldstxi.x87.nodata \
220 ldstr-c.x87.nodata ldstxr-c.x87.nodata ldstxi-c.x87.nodata \
221 ext.x87.nodata cvt.x87.nodata branch.x87.nodata \
222 alu_add.x87.nodata alux_add.x87.nodata \
223 alu_sub.x87.nodata alux_sub.x87.nodata alu_rsb.x87.nodata \
224 alu_mul.x87.nodata alu_hmul.x87.nodata \
225 alu_div.x87.nodata alu_rem.x87.nodata \
226 alu_and.x87.nodata alu_or.x87.nodata alu_xor.x87.nodata \
227 alu_lsh.x87.nodata alu_rsh.x87.nodata alu_rot.x87.nodata \
228 alu_com.x87.nodata alu_neg.x87.nodata \
229 movzr.x87.nodata fma.x87.nodata \
230 fop_abs.x87.nodata fop_sqrt.x87.nodata \
231 varargs.x87.nodata stack.x87.nodata \
232 clobber.x87.nodata carry.x87.nodata call.x87.nodata \
233 float.x87.nodata jmpr.x87.nodata put.x87.nodata \
234 va_list.x87.nodata imm.x87.nodata unldst.x87.nodata
235 $(x87_nodata_TESTS): check.x87.nodata.sh
236 $(LN_S) $(srcdir)/check.x87.nodata.sh $@
237 TESTS += $(x87_nodata_TESTS)
241 #arm_TESTS = $(addsuffix .arm, $(base_TESTS))
243 3to2.arm add.arm align.arm allocai.arm \
244 allocar.arm bp.arm divi.arm fib.arm \
245 rpn.arm ldstr.arm ldsti.arm \
246 ldstxr.arm ldstxi.arm \
247 ldstr-c.arm ldstxr-c.arm ldstxi-c.arm \
248 ext.arm cvt.arm hton.arm bswap.arm \
249 branch.arm alu_add.arm alux_add.arm \
250 alu_sub.arm alux_sub.arm alu_rsb.arm \
251 alu_mul.arm alu_hmul.arm \
252 alu_div.arm alu_rem.arm \
253 alu_and.arm alu_or.arm alu_xor.arm \
254 alu_lsh.arm alu_rsh.arm alu_rot.arm \
255 alu_com.arm alu_neg.arm \
257 fop_abs.arm fop_sqrt.arm \
258 varargs.arm stack.arm \
259 clobber.arm carry.arm call.arm \
260 float.arm jmpr.arm tramp.arm range.arm \
261 ranger.arm put.arm va_list.arm imm.arm \
263 $(arm_TESTS): check.arm.sh
264 $(LN_S) $(srcdir)/check.arm.sh $@
265 TESTS += $(arm_TESTS)
269 #swf_TESTS = $(addsuffix .swf, $(base_TESTS))
271 3to2.swf add.swf allocai.swf \
272 allocar.swf bp.swf divi.swf fib.swf \
273 rpn.swf ldstr.swf ldsti.swf \
274 ldstxr.swf ldstxi.swf \
275 ldstr-c.swf ldstxr-c.swf ldstxi-c.swf \
276 ext.swf cvt.swf hton.swf bswap.swf \
277 branch.swf alu_add.swf alux_add.swf \
278 alu_sub.swf alux_sub.swf alu_rsb.swf \
279 alu_mul.swf alu_hmul.swf \
280 alu_div.swf alu_rem.swf \
281 alu_and.swf alu_or.swf alu_xor.swf \
282 alu_lsh.swf alu_rsh.swf alu_rot.swf \
283 alu_com.swf alu_neg.swf \
285 fop_abs.swf fop_sqrt.swf \
286 varargs.swf stack.swf \
287 clobber.swf carry.swf call.swf \
288 float.swf jmpr.swf tramp.swf range.swf \
289 ranger.swf put.swf va_list.swf imm.swf \
291 $(swf_TESTS): check.swf.sh
292 $(LN_S) $(srcdir)/check.swf.sh $@
293 TESTS += $(swf_TESTS)
295 #arm_swf_TESTS = $(addsuffix .arm.swf, $(base_TESTS))
297 3to2.arm.swf add.arm.swf allocai.arm.swf \
298 allocar.arm.swf bp.arm.swf divi.arm.swf fib.arm.swf \
299 rpn.arm.swf ldstr.arm.swf ldsti.arm.swf \
300 ldstxr.arm.swf ldstxi.arm.swf \
301 ldstr-c.arm.swf ldstxr-c.arm.swf ldstxi-c.arm.swf \
302 ext.arm.swf cvt.arm.swf hton.arm.swf bswap.arm.swf \
303 branch.arm.swf alu_add.arm.swf alux_add.arm.swf \
304 alu_sub.arm.swf alux_sub.arm.swf alu_rsb.arm.swf \
305 alu_mul.arm.swf alu_div.arm.swf alu_rem.arm.swf \
306 alu_and.arm.swf alu_or.arm.swf alu_xor.arm.swf \
307 alu_lsh.arm.swf alu_rsh.arm.swf alu_rot.arm.swf \
308 alu_com.arm.swf alu_neg.arm.swf \
309 movzr.arm.swf fma.arm.swf \
310 fop_abs.arm.swf fop_sqrt.arm.swf \
311 varargs.arm.swf stack.arm.swf \
312 clobber.arm.swf carry.arm.swf call.arm.swf \
313 float.arm.swf jmpr.arm.swf tramp.arm.swf range.arm.swf \
314 ranger.arm.swf put.arm.swf va_list.arm.swf imm.arm.swf \
316 $(arm_swf_TESTS): check.arm.swf.sh
317 $(LN_S) $(srcdir)/check.arm.swf.sh $@
318 TESTS += $(arm_swf_TESTS)
321 #arm4_swf_TESTS = $(addsuffix .arm4.swf, $(base_TESTS))
323 3to2.arm4.swf add.arm4.swf allocai.arm4.swf \
324 allocar.arm4.swf bp.arm4.swf divi.arm4.swf fib.arm4.swf \
325 rpn.arm4.swf ldstr.arm4.swf ldsti.arm4.swf \
326 ldstxr.arm4.swf ldstxi.arm4.swf \
327 ldstr-c.arm4.swf ldstxr-c.arm4.swf ldstxi-c.arm4.swf \
328 ext.arm4.swf cvt.arm4.swf hton.arm4.swf bswap.arm4.swf \
329 branch.arm4.swf alu_add.arm4.swf alux_add.arm4.swf \
330 alu_sub.arm4.swf alux_sub.arm4.swf alu_rsb.arm4.swf \
331 alu_mul.arm4.swf alu_div.arm4.swf alu_rem.arm4.swf \
332 alu_and.arm4.swf alu_or.arm4.swf alu_xor.arm4.swf \
333 alu_lsh.arm4.swf alu_rsh.arm4.swf alu_rot.arm4.swf \
334 alu_com.arm4.swf alu_neg.arm4.swf \
335 movzr.arm4.swf fma.arm4.swf \
336 fop_abs.arm4.swf fop_sqrt.arm4.swf \
337 varargs.arm4.swf stack.arm4.swf \
338 clobber.arm4.swf carry.arm4.swf call.arm4.swf \
339 float.arm4.swf jmpr.arm4.swf tramp.arm4.swf \
340 range.arm4.swf ranger.arm4.swf put.arm4.swf \
341 va_list.arm4.swf imm.arm4.swf \
343 $(arm4_swf_TESTS): check.arm4.swf.sh
344 $(LN_S) $(srcdir)/check.arm4.swf.sh $@
345 TESTS += $(arm4_swf_TESTS)
350 #nodata_TESTS = $(addsuffix .nodata, $(base_TESTS))
352 3to2.nodata add.nodata allocai.nodata \
353 allocar.nodata bp.nodata divi.nodata fib.nodata \
354 rpn.nodata ldstr.nodata ldsti.nodata \
355 ldstxr.nodata ldstxi.nodata \
356 ldstr-c.nodata ldstxr-c.nodata ldstxi-c.nodata \
357 ext.nodata cvt.nodata branch.nodata \
358 alu_add.nodata alux_add.nodata \
359 alu_sub.nodata alux_sub.nodata alu_rsb.nodata \
360 alu_mul.nodata alu_hmul.nodata \
361 alu_div.nodata alu_rem.nodata \
362 alu_and.nodata alu_or.nodata alu_xor.nodata \
363 alu_lsh.nodata alu_rsh.nodata alu_rot.nodata \
364 alu_com.nodata alu_neg.nodata \
365 movzr.nodata fma.nodata \
366 fop_abs.nodata fop_sqrt.nodata \
367 varargs.nodata stack.nodata \
368 clobber.nodata carry.nodata call.nodata \
369 float.nodata jmpr.nodata tramp.nodata \
370 range.nodata ranger.nodata put.nodata \
371 va_list.nodata bit.nodata imm.nodata \
373 $(nodata_TESTS): check.nodata.sh
374 $(LN_S) $(srcdir)/check.nodata.sh $@
375 TESTS += $(nodata_TESTS)
378 TESTS += ccall self setcode nodata ctramp carg cva_list catomic \
379 protect riprel cbit callee
380 CLEANFILES = $(TESTS) gen_cbit cbit.c
382 #TESTS_ENVIRONMENT=$(srcdir)/run-test;
385 $(LIBTOOL) --mode=execute gdb lightning