Allow REPL to access the lexical variables in compiled code (when compiled with ...
[gambit-c.git] / tests / makefile.in
blob127122ce56f8e475ad795d36158cd4fc0fe078a5
1 # makefile for regression tests, Time-stamp: <2009-08-05 00:19:04 feeley>
3 # Copyright (c) 1994-2009 by Marc Feeley, All Rights Reserved.
5 herefromroot = tests
6 rootfromhere = ..
7 SUBDIRS =
9 PACKAGE_SHORTNAME = @PACKAGE_SHORTNAME@
10 PACKAGE_NAME = @PACKAGE_NAME@
11 PACKAGE_VERSION = @PACKAGE_VERSION@
12 PACKAGE_STRING = @PACKAGE_STRING@
13 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
14 PACKAGE_TARNAME = @PACKAGE_TARNAME@
16 @SET_MAKE@
18 srcdir = @srcdir@
19 VPATH = @srcdir@
20 srcdirpfx = @srcdirpfx@
22 C_COMPILER = @C_COMPILER_MF@
23 C_PREPROC = @C_PREPROC_MF@
24 FLAGS_OBJ = @FLAGS_OBJ_MF@
25 FLAGS_DYN = @FLAGS_DYN_MF@
26 FLAGS_LIB = @FLAGS_LIB_MF@
27 FLAGS_EXE = @FLAGS_EXE_MF@
28 DEFS = @DEFS@
29 LIBS = @LIBS@
31 GAMBCLIB_DEFS = @GAMBCLIB_DEFS_MF@
32 LIB_PREFIX = @LIB_PREFIX@
33 LIB_EXTENSION = @LIB_EXTENSION@
34 GAMBCLIB = @GAMBCLIB@
35 GAMBCGSCLIB = @GAMBCGSCLIB@
36 GAMBCGSILIB = @GAMBCGSILIB@
37 INSTALL = @INSTALL@
38 INSTALL_DATA = @INSTALL_DATA@
39 INSTALL_LIB = @INSTALL_LIB@
40 INSTALL_PROGRAM = @INSTALL_PROGRAM@
41 LN_S = @LN_S@
42 RANLIB = @RANLIB@
43 RC = @RC@
44 GIT = @GIT@
45 HG = @HG@
47 prefix = @prefix@
48 exec_prefix = @exec_prefix@
49 includedir = @includedir@
50 libdir = @libdir@
51 bindir = @bindir@
52 docdir = @docdir@
53 infodir = @infodir@
54 emacsdir = @emacsdir@
55 libexecdir = @libexecdir@
56 datarootdir = @datarootdir@
57 datadir = @datadir@
58 htmldir = @htmldir@
59 dvidir = @dvidir@
60 pdfdir = @pdfdir@
61 psdir = @psdir@
62 localedir = @localedir@
63 mandir = @mandir@
65 .SUFFIXES:
67 RCFILES = makefile.in \
68 debug.scm error.scm r4rstest.scm mix.scm mem.scm client.c server.scm server.h \
69 test1.ok test2.ok test3.ok test4.ok test5.ok test6.ok test7.ok \
70 test8.ok test9.ok test10.scm input
72 GENDISTFILES =
74 DISTFILES = $(RCFILES) $(GENDISTFILES)
76 GAMBCDIR_INCLUDE = $(srcdirpfx)$(rootfromhere)/include
77 GAMBCDIR_LIB = $(srcdirpfx)$(rootfromhere)/lib
78 GAMBCDIR_LIB_GSI = $(srcdirpfx)$(rootfromhere)/gsi
79 GAMBCDIR_LIB_GSC = $(srcdirpfx)$(rootfromhere)/gsc
81 all:
83 all-pre:
85 all-post:
86 @if [ ! -f debug.scm ]; then \
87 cp $(srcdirpfx)debug.scm .; \
88 touch debug.rm; \
89 cp $(srcdirpfx)error.scm .; \
90 touch error.rm; \
91 cp $(srcdirpfx)r4rstest.scm .; \
92 touch r4rstest.rm; \
93 cp $(srcdirpfx)mix.scm .; \
94 touch mix.rm; \
95 cp $(srcdirpfx)mem.scm .; \
96 touch mem.rm; \
97 cp $(srcdirpfx)server.scm .; \
98 touch server.rm; \
101 check: all test1 test2 test3 test4 test5 test6 test7 test8 test9 test10
102 @echo "============ ALL TESTS SUCCESSFUL"
103 rm -f mem.c mem_.c mem@obj@ mem.o1 mem_@obj@ mem@exe@ \
104 mix.c mix_.c mix@obj@ mix_@obj@ mix@exe@ \
105 server.c server_.c server@obj@ server_@obj@ client@obj@ \
106 client@exe@ so_locations *.out tmp*
108 test1:
109 @echo "------------ TEST 1 (debugging support)"
110 @SETDLPATH@ $(rootfromhere)/gsi/gsi -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f debug.scm > test1.out
111 diff $(srcdirpfx)test1.ok test1.out && rm -f test1.out
113 test2:
114 @echo "------------ TEST 2 (error handling)"
115 @SETDLPATH@ $(rootfromhere)/gsi/gsi -:h4000,~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f error.scm < error.scm > test2.out
116 diff $(srcdirpfx)test2.ok test2.out && rm -f test2.out
118 test3:
119 @echo "------------ TEST 3 (interpreter and library functions)"
120 @SETDLPATH@ $(rootfromhere)/gsi/gsi -:s,~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -e '(begin (load "r4rstest.scm") (test-cont) (test-sc4) (test-delay) (exit))' > test3.out
121 diff $(srcdirpfx)test3.ok test3.out && rm -f test3.out tmp*
123 test4:
124 @echo "------------ TEST 4 (interpreter running an application)"
125 rm -f mix@obj@
126 @SETDLPATH@ $(rootfromhere)/gsi/gsi -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f mix.scm > test4.out
127 diff $(srcdirpfx)test4.ok test4.out && rm -f test4.out
129 test5:
130 @echo "------------ TEST 5 (compiler generating C code)"
131 rm -f mix.c
132 @SETDLPATH@ $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -c mix.scm
133 diff $(srcdirpfx)test5.ok mix.c
135 test6: test5
136 @echo "------------ TEST 6 (link and execute the code generated)"
137 rm -f mix_.c mix@obj@ mix_@obj@ mix@exe@
138 @SETDLPATH@ $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -o mix@exe@ -exe mix.c
139 @SETDLPATH@ ./mix@exe@ -:m4000 > test6.out
140 diff $(srcdirpfx)test6.ok test6.out && \
141 rm -f test6.out mix.c mix_.c mix@obj@ mix_@obj@ mix@exe@
143 test7:
144 @echo "------------ TEST 7 (memory management and C-interface)"
145 rm -f mem.c mem_.c mem@obj@ mem_@obj@ mem@exe@
146 @SETDLPATH@ $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -o mem@exe@ -exe mem.scm
147 @SETDLPATH@ ./mem@exe@ -:h4000 > test7.out
148 diff $(srcdirpfx)test7.ok test7.out && \
149 rm -f test7.out mem.c mem_.c mem@obj@ mem_@obj@ mem@exe@
151 test8:
152 @echo "------------ TEST 8 (use C-interface to implement a Scheme server)"
153 rm -f server.c server_.c server@obj@ server_@obj@ \
154 client@obj@ client@exe@
155 @SETDLPATH@ $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -link server.scm
156 $(MAKE) build_obj \
157 BUILD_OBJ_OUTPUT_FILENAME="client@obj@" \
158 BUILD_OBJ_CC_OPTIONS="" \
159 BUILD_OBJ_INPUT_FILENAMES="client.c"
160 $(MAKE) build_obj_library \
161 BUILD_OBJ_OUTPUT_FILENAME="server@obj@" \
162 BUILD_OBJ_CC_OPTIONS="" \
163 BUILD_OBJ_INPUT_FILENAMES="server.c"
164 $(MAKE) build_obj_library \
165 BUILD_OBJ_OUTPUT_FILENAME="server_@obj@" \
166 BUILD_OBJ_CC_OPTIONS="" \
167 BUILD_OBJ_INPUT_FILENAMES="server_.c"
168 $(MAKE) build_exe \
169 BUILD_EXE_OUTPUT_FILENAME="client@exe@" \
170 BUILD_EXE_CC_OPTIONS="" \
171 BUILD_EXE_LD_OPTIONS_PRELUDE="" \
172 BUILD_EXE_INPUT_FILENAMES="client@obj@ server@obj@ server_@obj@" \
173 BUILD_EXE_LD_OPTIONS=""
174 @SETDLPATH@ ./client@exe@ > test8.out
175 diff -w $(srcdirpfx)test8.ok test8.out && \
176 rm -f test8.out server.c server_.c server@obj@ server_@obj@ \
177 client@obj@ client@exe@
179 test9: test7
180 @echo "------------ TEST 9 (dynamic compilation and loading of a module)"
181 rm -f mem@obj@ mem.o*
182 @SETDLPATH@ $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f mem.scm
183 @SETDLPATH@ $(rootfromhere)/gsi/gsi -:h4000 -f mem.o1 > test9.out
184 diff $(srcdirpfx)test9.ok test9.out && rm -f test9.out mem@obj@ mem.o1
186 test10:
187 @echo "------------ TEST 10 (consistency of lib/gambit#.scm)"
188 rm -f mem@obj@ mem.o*
189 @SETDLPATH@ $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -i test10.scm
191 build_obj:
192 @BUILD_OBJ@
194 build_obj_library:
195 @BUILD_OBJ@ -D___LIBRARY
197 build_exe:
198 @BUILD_EXE@
200 install-pre:
202 install-post: all
204 uninstall-pre:
206 uninstall-post:
208 mostlyclean-pre:
210 mostlyclean-post:
211 rm -f mem.c mem_.c mem@obj@ mem.o1 mem_@obj@ mem mem.exe \
212 mix.c mix_.c mix@obj@ mix_@obj@ mix mix.exe \
213 server.c server_.c server@obj@ server_@obj@ client@obj@ client \
214 client.exe gambit.h so_locations *.out tmp*
216 clean-pre: mostlyclean-pre
218 clean-post: mostlyclean-post
219 test ! -f debug.rm || rm -f debug.rm debug.scm
220 test ! -f error.rm || rm -f error.rm error.scm
221 test ! -f r4rstest.rm || rm -f r4rstest.rm r4rstest.scm
222 test ! -f mix.rm || rm -f mix.rm mix.scm
223 test ! -f mem.rm || rm -f mem.rm mem.scm
224 test ! -f server.rm || rm -f server.rm server.scm
225 rm -f *.da *.bb *.bbg *.gcov *.gcno *.gcda
227 distclean-pre: clean-pre
229 distclean-post: clean-post
231 bootclean-pre: distclean-pre
233 bootclean-post: distclean-post
235 realclean-pre: bootclean-pre
237 realclean-post: bootclean-post
238 rm -f makefile
240 rc-setup-pre:
241 $(RC) add $(RCFILES)
243 rc-setup-post:
245 dist-pre dist-devel-pre:
246 mkdir $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot)
247 chmod 777 $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot)
248 @echo " Copying distribution files:"
249 @for file in $(DISTFILES); do \
250 echo " $(herefromroot)/$$file"; \
251 ln $(srcdirpfx)$$file $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot) 2> /dev/null \
252 || cp -p $(srcdirpfx)$$file $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot); \
253 done
255 dist-post dist-devel-post:
257 all-recursive install-recursive uninstall-recursive mostlyclean-recursive clean-recursive distclean-recursive bootclean-recursive realclean-recursive rc-setup-recursive dist-recursive dist-devel-recursive:
258 @if test -n "$(SUBDIRS)"; then \
259 for subdir in ""$(SUBDIRS); do \
260 target=`echo $@ | sed 's/-recursive//'`; \
261 echo making $$target in $$subdir; \
262 (cd $$subdir && $(MAKE) $$target) || exit 1; \
263 done \
266 all: all-post
268 all-post: all-recursive
270 all-recursive: all-pre
272 install: install-post
274 install-post: install-recursive
276 install-recursive: install-pre
278 uninstall: uninstall-post
280 uninstall-post: uninstall-recursive
282 uninstall-recursive: uninstall-pre
284 mostlyclean: mostlyclean-post
286 mostlyclean-post: mostlyclean-recursive
288 mostlyclean-recursive: mostlyclean-pre
290 clean: clean-post
292 clean-post: clean-recursive
294 clean-recursive: clean-pre
296 distclean: distclean-post
298 distclean-post: distclean-recursive
300 distclean-recursive: distclean-pre
302 bootclean: bootclean-post
304 bootclean-post: bootclean-recursive
306 bootclean-recursive: bootclean-pre
308 realclean: realclean-post
310 realclean-post: realclean-recursive
312 realclean-recursive: realclean-pre
314 rc-setup: rc-setup-post
316 rc-setup-post: rc-setup-recursive
318 rc-setup-recursive: rc-setup-pre
320 dist: dist-post
322 dist-post: dist-recursive
324 dist-recursive: dist-pre
326 dist-devel: dist-devel-post
328 dist-devel-post: dist-devel-recursive
330 dist-devel-recursive: dist-devel-pre
332 makefile: makefile.in $(rootfromhere)/config.status
333 cd $(rootfromhere) && CONFIG_FILES=$(herefromroot)/$@ CONFIG_HEADERS= ./config.status
335 # Tell versions [3.59,3.63) of GNU make not to export all variables.
336 # Otherwise a system limit (for SysV at least) may be exceeded.
337 .NOEXPORT: