Fix makefile dependencies to allow concurrent build (thanks to Adrien Pierard for...
[gambit-c.git] / tests / makefile.in
blobe7195c003eb72b12525d7e5de551f1f556750195
1 # makefile for regression tests, Time-stamp: <2009-06-12 11:07:24 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@
23 C_PREPROC = @C_PREPROC@
24 FLAGS_OBJ = @FLAGS_OBJ@
25 FLAGS_DYN = @FLAGS_DYN@
26 FLAGS_LIB = @FLAGS_LIB@
27 FLAGS_EXE = @FLAGS_EXE@
28 DEFS = @DEFS@
29 LIBS = @LIBS@
31 LIBRARY_DEFS = @LIBRARY_DEFS@
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 INCLUDES = -I$(srcdirpfx)$(rootfromhere)/include -I$(srcdir)
67 .SUFFIXES:
69 RCFILES = makefile.in \
70 debug.scm error.scm r4rstest.scm mix.scm mem.scm client.c server.scm server.h \
71 test1.ok test2.ok test3.ok test4.ok test5.ok test6.ok test7.ok \
72 test8.ok test9.ok test10.scm input
74 GENDISTFILES =
76 DISTFILES = $(RCFILES) $(GENDISTFILES)
78 all:
80 all-pre:
82 all-post:
83 @if [ ! -f debug.scm ]; then \
84 cp $(srcdirpfx)debug.scm .; \
85 touch debug.rm; \
86 cp $(srcdirpfx)error.scm .; \
87 touch error.rm; \
88 cp $(srcdirpfx)r4rstest.scm .; \
89 touch r4rstest.rm; \
90 cp $(srcdirpfx)mix.scm .; \
91 touch mix.rm; \
92 cp $(srcdirpfx)mem.scm .; \
93 touch mem.rm; \
94 cp $(srcdirpfx)server.scm .; \
95 touch server.rm; \
98 check: all test1 test2 test3 test4 test5 test6 test7 test8 test9 test10
99 @echo "============ ALL TESTS SUCCESSFUL"
100 rm -f mem.c mem_.c mem@obj@ mem.o1 mem_@obj@ mem@exe@ \
101 mix.c mix_.c mix@obj@ mix_@obj@ mix@exe@ \
102 server.c server_.c server@obj@ server_@obj@ client@obj@ \
103 client@exe@ so_locations *.out tmp*
105 test1:
106 @echo "------------ TEST 1 (debugging support)"
107 @SETDLPATH@ $(rootfromhere)/gsi/gsi -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f debug.scm > test1.out
108 diff $(srcdirpfx)test1.ok test1.out && rm -f test1.out
110 test2:
111 @echo "------------ TEST 2 (error handling)"
112 @SETDLPATH@ $(rootfromhere)/gsi/gsi -:h4000,~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f error.scm < error.scm > test2.out
113 diff $(srcdirpfx)test2.ok test2.out && rm -f test2.out
115 test3:
116 @echo "------------ TEST 3 (interpreter and library functions)"
117 @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
118 diff $(srcdirpfx)test3.ok test3.out && rm -f test3.out tmp*
120 test4:
121 @echo "------------ TEST 4 (interpreter running an application)"
122 rm -f mix@obj@
123 @SETDLPATH@ $(rootfromhere)/gsi/gsi -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f mix.scm > test4.out
124 diff $(srcdirpfx)test4.ok test4.out && rm -f test4.out
126 test5:
127 @echo "------------ TEST 5 (compiler generating C code)"
128 rm -f mix.c
129 @SETDLPATH@ $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -c mix.scm
130 diff $(srcdirpfx)test5.ok mix.c
132 test6: test5
133 @echo "------------ TEST 6 (link and execute the code generated)"
134 rm -f mix_.c mix@obj@ mix_@obj@ mix@exe@
135 @SETDLPATH@ $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -link mix.c
136 $(C_COMPILER) $(INCLUDES) $(FLAGS_OBJ) -c mix.c
137 $(C_COMPILER) $(INCLUDES) $(FLAGS_OBJ) -c mix_.c
138 $(MAKE) link EXECUTABLE="mix@exe@" \
139 LINK_LIBS="$(rootfromhere)/lib/$(LIB_PREFIX)$(GAMBCLIB)$(LIB_EXTENSION)" \
140 EXECUTABLE_OBJECTS="mix@obj@ mix_@obj@" \
141 EXECUTABLE_OBJECTS_PLUS="+mix@obj@ +mix_@obj@" \
142 EXECUTABLE_OBJECTS_COMMA="mix@obj@,mix_@obj@"
143 @SETDLPATH@ ./mix@exe@ -:m4000 > test6.out
144 diff $(srcdirpfx)test6.ok test6.out && \
145 rm -f test6.out mix.c mix_.c mix@obj@ mix_@obj@ mix@exe@
147 test7:
148 @echo "------------ TEST 7 (memory management and C-interface)"
149 rm -f mem.c mem_.c mem@obj@ mem_@obj@ mem@exe@
150 @SETDLPATH@ $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -link mem.scm
151 $(C_COMPILER) $(INCLUDES) $(FLAGS_OBJ) -c mem.c
152 $(C_COMPILER) $(INCLUDES) $(FLAGS_OBJ) -c mem_.c
153 $(MAKE) link EXECUTABLE="mem@exe@" \
154 LINK_LIBS="$(rootfromhere)/lib/$(LIB_PREFIX)$(GAMBCLIB)$(LIB_EXTENSION)" \
155 EXECUTABLE_OBJECTS="mem@obj@ mem_@obj@" \
156 EXECUTABLE_OBJECTS_PLUS="+mem@obj@ +mem_@obj@" \
157 EXECUTABLE_OBJECTS_COMMA="mem@obj@,mem_@obj@"
158 @SETDLPATH@ ./mem@exe@ -:h4000 > test7.out
159 diff $(srcdirpfx)test7.ok test7.out && \
160 rm -f test7.out mem.c mem_.c mem@obj@ mem_@obj@ mem@exe@
162 test8:
163 @echo "------------ TEST 8 (use C-interface to implement a Scheme server)"
164 rm -f server.c server_.c server@obj@ server_@obj@ \
165 client@obj@ client@exe@
166 @SETDLPATH@ $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -link server.scm
167 $(C_COMPILER) $(INCLUDES) $(FLAGS_OBJ) -c client.c
168 $(C_COMPILER) $(INCLUDES) $(FLAGS_OBJ) -D___LIBRARY -c server.c
169 $(C_COMPILER) $(INCLUDES) $(FLAGS_OBJ) -D___LIBRARY -c server_.c
170 $(MAKE) link EXECUTABLE="client@exe@" \
171 LINK_LIBS="$(rootfromhere)/lib/$(LIB_PREFIX)$(GAMBCLIB)$(LIB_EXTENSION)" \
172 EXECUTABLE_OBJECTS="client@obj@ server@obj@ server_@obj@" \
173 EXECUTABLE_OBJECTS_PLUS="+client@obj@ +server@obj@ +server_@obj@" \
174 EXECUTABLE_OBJECTS_COMMA="client@obj@,server@obj@,server_@obj@"
175 @SETDLPATH@ ./client@exe@ > test8.out
176 diff -w $(srcdirpfx)test8.ok test8.out && \
177 rm -f test8.out server.c server_.c server@obj@ server_@obj@ \
178 client@obj@ client@exe@
180 test9: test7
181 @echo "------------ TEST 9 (dynamic compilation and loading of a module)"
182 rm -f mem@obj@ mem.o*
183 @SETDLPATH@ $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f mem.scm
184 @SETDLPATH@ $(rootfromhere)/gsi/gsi -:h4000 -f mem.o1 > test9.out
185 diff $(srcdirpfx)test9.ok test9.out && rm -f test9.out mem@obj@ mem.o1
187 test10:
188 @echo "------------ TEST 10 (consistency of lib/gambit#.scm)"
189 rm -f mem@obj@ mem.o*
190 @SETDLPATH@ $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -i test10.scm
192 link:
193 @LINK@
195 install-pre:
197 install-post: all
199 uninstall-pre:
201 uninstall-post:
203 mostlyclean-pre:
205 mostlyclean-post:
206 rm -f mem.c mem_.c mem@obj@ mem.o1 mem_@obj@ mem mem.exe \
207 mix.c mix_.c mix@obj@ mix_@obj@ mix mix.exe \
208 server.c server_.c server@obj@ server_@obj@ client@obj@ client \
209 client.exe gambit.h so_locations *.out tmp*
211 clean-pre: mostlyclean-pre
213 clean-post: mostlyclean-post
214 test ! -f debug.rm || rm -f debug.rm debug.scm
215 test ! -f error.rm || rm -f error.rm error.scm
216 test ! -f r4rstest.rm || rm -f r4rstest.rm r4rstest.scm
217 test ! -f mix.rm || rm -f mix.rm mix.scm
218 test ! -f mem.rm || rm -f mem.rm mem.scm
219 test ! -f server.rm || rm -f server.rm server.scm
220 rm -f *.da *.bb *.bbg *.gcov *.gcno *.gcda
222 distclean-pre: clean-pre
224 distclean-post: clean-post
226 bootclean-pre: distclean-pre
228 bootclean-post: distclean-post
230 realclean-pre: bootclean-pre
232 realclean-post: bootclean-post
233 rm -f makefile
235 rc-setup-pre:
236 $(RC) add $(RCFILES)
238 rc-setup-post:
240 dist-pre dist-devel-pre:
241 mkdir $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot)
242 chmod 777 $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot)
243 @echo " Copying distribution files:"
244 @for file in $(DISTFILES); do \
245 echo " $(herefromroot)/$$file"; \
246 ln $(srcdirpfx)$$file $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot) 2> /dev/null \
247 || cp -p $(srcdirpfx)$$file $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot); \
248 done
250 dist-post dist-devel-post:
252 all-recursive install-recursive uninstall-recursive mostlyclean-recursive clean-recursive distclean-recursive bootclean-recursive realclean-recursive rc-setup-recursive dist-recursive dist-devel-recursive:
253 @if test -n "$(SUBDIRS)"; then \
254 for subdir in ""$(SUBDIRS); do \
255 target=`echo $@ | sed 's/-recursive//'`; \
256 echo making $$target in $$subdir; \
257 (cd $$subdir && $(MAKE) $$target) || exit 1; \
258 done \
261 all: all-post
263 all-post: all-recursive
265 all-recursive: all-pre
267 install: install-post
269 install-post: install-recursive
271 install-recursive: install-pre
273 uninstall: uninstall-post
275 uninstall-post: uninstall-recursive
277 uninstall-recursive: uninstall-pre
279 mostlyclean: mostlyclean-post
281 mostlyclean-post: mostlyclean-recursive
283 mostlyclean-recursive: mostlyclean-pre
285 clean: clean-post
287 clean-post: clean-recursive
289 clean-recursive: clean-pre
291 distclean: distclean-post
293 distclean-post: distclean-recursive
295 distclean-recursive: distclean-pre
297 bootclean: bootclean-post
299 bootclean-post: bootclean-recursive
301 bootclean-recursive: bootclean-pre
303 realclean: realclean-post
305 realclean-post: realclean-recursive
307 realclean-recursive: realclean-pre
309 rc-setup: rc-setup-post
311 rc-setup-post: rc-setup-recursive
313 rc-setup-recursive: rc-setup-pre
315 dist: dist-post
317 dist-post: dist-recursive
319 dist-recursive: dist-pre
321 dist-devel: dist-devel-post
323 dist-devel-post: dist-devel-recursive
325 dist-devel-recursive: dist-devel-pre
327 makefile: makefile.in $(rootfromhere)/config.status
328 cd $(rootfromhere) && CONFIG_FILES=$(herefromroot)/$@ CONFIG_HEADERS= ./config.status
330 # Tell versions [3.59,3.63) of GNU make not to export all variables.
331 # Otherwise a system limit (for SysV at least) may be exceeded.
332 .NOEXPORT: