Add missing logic for 'prebuilt' target
[gambit-c.git] / makefile.in
blob5a2f4a7df987e0055c44469fcc2c5eb21b1168c5
1 # makefile for Gambit-C system.
3 # Copyright (c) 1994-2009 by Marc Feeley, All Rights Reserved.
5 PACKAGE_SHORTNAME = @PACKAGE_SHORTNAME@
6 PACKAGE_NAME = @PACKAGE_NAME@
7 PACKAGE_VERSION = @PACKAGE_VERSION@
8 PACKAGE_STRING = @PACKAGE_STRING@
9 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
10 PACKAGE_TARNAME = @PACKAGE_TARNAME@
12 @SET_MAKE@
14 srcdir = @srcdir@
15 VPATH = @srcdir@
16 srcdirpfx = @srcdirpfx@
18 C_COMPILER = @C_COMPILER_MF@
19 C_PREPROC = @C_PREPROC_MF@
20 FLAGS_OBJ = @FLAGS_OBJ_MF@
21 FLAGS_DYN = @FLAGS_DYN_MF@
22 FLAGS_LIB = @FLAGS_LIB_MF@
23 FLAGS_EXE = @FLAGS_EXE_MF@
24 DEFS = @DEFS@
25 LIBS = @LIBS@
27 GAMBCLIB_DEFS = @GAMBCLIB_DEFS_MF@
28 LIB_PREFIX = @LIB_PREFIX@
29 LIB_EXTENSION = @LIB_EXTENSION@
30 GAMBCLIB = @GAMBCLIB@
31 GAMBCGSCLIB = @GAMBCGSCLIB@
32 GAMBCGSILIB = @GAMBCGSILIB@
33 INSTALL = @INSTALL@
34 INSTALL_DATA = @INSTALL_DATA@
35 INSTALL_LIB = @INSTALL_LIB@
36 INSTALL_PROGRAM = @INSTALL_PROGRAM@
37 LN_S = @LN_S@
38 RANLIB = @RANLIB@
39 RC = @RC@
40 GIT = @GIT@
41 HG = @HG@
43 prefix = @prefix@
44 exec_prefix = @exec_prefix@
45 includedir = @includedir@
46 libdir = @libdir@
47 bindir = @bindir@
48 docdir = @docdir@
49 infodir = @infodir@
50 emacsdir = @emacsdir@
51 libexecdir = @libexecdir@
52 datarootdir = @datarootdir@
53 datadir = @datadir@
54 htmldir = @htmldir@
55 dvidir = @dvidir@
56 pdfdir = @pdfdir@
57 psdir = @psdir@
58 localedir = @localedir@
59 mandir = @mandir@
61 # This directory's subdirectories are mostly independent; you can cd
62 # into them and run `make' without going through this makefile.
63 # To change the values of `make' variables: instead of editing makefiles,
64 # (1) if the variable is set in `config.status', edit `config.status'
65 # (which will cause the makefiles to be regenerated when you run `make');
66 # (2) otherwise, pass the desired values on the `make' command line.
68 MDEFINES = prefix=$(prefix) exec_prefix=$(exec_prefix) \
69 includedir=$(includedir) libdir=$(libdir) \
70 bindir=$(bindir) docdir=$(docdir) \
71 infodir=$(infodir) emacsdir=$(emacsdir)
73 SUBDIRS = include lib gsi gsc bin misc doc tests examples prebuilt
75 RCFILES = README INSTALL.txt LICENSE-2.0.txt LGPL.txt \
76 makefile.in configure configure.ac config.guess config.sub install-sh mkidirs \
77 relpath
79 GITRCFILES = .gitignore .gitattributes
80 HGRCFILES = .hgignore .hgtags
82 GENDISTFILES =
84 DISTFILES = $(RCFILES) $(GENDISTFILES)
86 GITDISTFILES = $(GITRCFILES)
87 HGDISTFILES = $(HGRCFILES)
89 .SUFFIXES:
91 all:
93 all-pre:
95 all-post:
96 test -f "gsc-comp@exe@" || cp gsc/gsc@exe@ gsc-comp@exe@
98 fake_target:
100 doc info pdf html txt: fake_target
101 cd doc && $(MAKE) $(MDEFINES) $@
103 bootstrap: fake_target all
104 cp gsc/gsc@exe@ gsc-comp@exe@
106 check: fake_target all
107 cd tests && $(MAKE) $(MDEFINES) $@
109 examples: fake_target all
110 cd examples && $(MAKE) $(MDEFINES) $@
112 prebuilt: dist dist-devel
113 cd prebuilt && $(MAKE) $(MDEFINES) $@
115 stamp: fake_target
116 cd include && $(MAKE) $(MDEFINES) $@
118 commit: fake_target stamp
119 @if test "$(RC)" = "$(GIT)"; then \
120 $(GIT) commit -a; \
121 else \
122 $(HG) commit; \
125 diff: fake_target
126 @$(RC) diff | cat
128 log: fake_target
129 @$(RC) log | cat
131 status: fake_target
132 @$(RC) status || :
134 push: fake_target
135 @if test "$(RC)" = "$(GIT)"; then \
136 $(GIT) push ssh://gambit@public-gambit-repo/~/HTML/repo/gambit.git/; \
137 else \
138 $(HG) push; \
141 pull: fake_target
142 @if test "$(RC)" = "$(GIT)"; then \
143 $(GIT) pull; \
144 $(GIT) fetch --tags; \
145 else \
146 $(HG) pull; \
149 update-nopull: fake_target
150 @if test "$(RC)" = "$(GIT)"; then \
151 next_version=`$(GIT) tag | fgrep -e '-bootstrap' | sed -e 's/v//g' -e 's/-bootstrap.*//g' | sort -r -s -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n | sed 's/^/v/g' | sed -n '/^$(PACKAGE_VERSION)/{n;p;}'`; \
152 else \
153 next_version=`$(HG) tags | fgrep -e '-bootstrap' | sed -e 's/v//g' -e 's/-bootstrap.*//g' | sort -r -s -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n | sed 's/^/v/g' | sed -n '/^$(PACKAGE_VERSION)/{n;p;}'`; \
154 fi; \
155 if test "$$next_version" = ""; then \
156 if test "$(RC)" = "$(GIT)"; then \
157 $(GIT) checkout master; \
158 else \
159 $(HG) checkout; \
160 fi; \
161 else \
162 $(RC) checkout $$next_version-bootstrap; \
163 $(MAKE) bootstrap; \
164 $(RC) checkout $$next_version; \
165 $(MAKE) bootclean bootstrap update; \
168 update: pull update-nopull
169 $(MAKE)
171 new-major: fake_target
172 major=`echo $(PACKAGE_VERSION) | sed -e "s/v//g" -e "s/\.[^.]*\.[^.]*//g"`; \
173 next_major=`eval expr 1 + $$major`; \
174 next_version=v$$next_major.0.0; \
175 $(MAKE) NEW_VERSION=$$next_version change-version
177 new-minor: fake_target
178 major=`echo $(PACKAGE_VERSION) | sed -e "s/v//g" -e "s/\.[^.]*\.[^.]*//g"`; \
179 minor=`echo $(PACKAGE_VERSION) | sed -e "s/v[^.]*\.//g" -e "s/\.[^.]*//g"`; \
180 next_minor=`eval expr 1 + $$minor`; \
181 next_version=v$$major.$$next_minor.0; \
182 $(MAKE) NEW_VERSION=$$next_version change-version
184 new-revision: fake_target
185 major=`echo $(PACKAGE_VERSION) | sed -e "s/v//g" -e "s/\.[^.]*\.[^.]*//g"`; \
186 minor=`echo $(PACKAGE_VERSION) | sed -e "s/v[^.]*\.//g" -e "s/\.[^.]*//g"`; \
187 revision=`echo $(PACKAGE_VERSION) | sed -e "s/v[^.]*\.[^.]*\.//g" -e "s///g"`; \
188 next_revision=`eval expr 1 + $$revision`; \
189 next_version=v$$major.$$minor.$$next_revision; \
190 $(MAKE) NEW_VERSION=$$next_version change-version
192 change-version: fake_target
193 major=`echo $(PACKAGE_VERSION) | sed -e "s/v//g" -e "s/\.[^.]*\.[^.]*//g"`; \
194 minor=`echo $(PACKAGE_VERSION) | sed -e "s/v[^.]*\.//g" -e "s/\.[^.]*//g"`; \
195 revision=`echo $(PACKAGE_VERSION) | sed -e "s/v[^.]*\.[^.]*\.//g" -e "s///g"`; \
196 next_major=`echo $(NEW_VERSION) | sed -e "s/v//g" -e "s/\.[^.]*\.[^.]*//g"`; \
197 next_minor=`echo $(NEW_VERSION) | sed -e "s/v[^.]*\.//g" -e "s/\.[^.]*//g"`; \
198 next_revision=`echo $(NEW_VERSION) | sed -e "s/v[^.]*\.[^.]*\.//g" -e "s///g"`; \
199 version_num=`eval expr "\( 100000 \\* $$major \) + \( 1000 \\* $$minor \) + $$revision"`; \
200 new_version_num=`eval expr "\( 100000 \\* $$next_major \) + \( 1000 \\* $$next_minor \) + $$next_revision"`; \
201 sed -e "/(define (compiler-version) $$version_num)/s/$$version_num/$$new_version_num/" gsc/_parms.scm > gsc/_parms.scm-new; \
202 if ! diff gsc/_parms.scm gsc/_parms.scm-new > /dev/null; then \
203 mv gsc/_parms.scm-new gsc/_parms.scm; \
204 if test "$(RC)" = "$(GIT)"; then \
205 $(GIT) commit -a -m "[COMPILER CHANGES NEEDED FOR $(NEW_VERSION)] Changed version in compiler"; \
206 else \
207 $(HG) commit -m "[COMPILER CHANGES NEEDED FOR $(NEW_VERSION)] Changed version in compiler"; \
208 fi; \
209 $(RC) tag $(NEW_VERSION)-bootstrap; \
210 if $(MAKE) bootstrap; then \
211 misc/changev $$version_num $$new_version_num; \
212 touch doc/gambit-c.txi; \
213 cd tests; @SETDLPATH@ ../gsc/gsc -:~~bin=../bin,~~lib=../lib,~~include=../include -f -c mix.scm; mv mix.c test5.ok; cd ..; \
214 if $(MAKE) bootclean && $(MAKE) -j 2 && $(MAKE) check && $(MAKE) doc; then \
215 if test "$(RC)" = "$(GIT)"; then \
216 $(GIT) commit -a -m "[RUNTIME CHANGES NEEDED FOR $(NEW_VERSION)] Changed version of runtime using misc/changev"; \
217 else \
218 $(HG) commit -m "[RUNTIME CHANGES NEEDED FOR $(NEW_VERSION)] Changed version of runtime using misc/changev"; \
219 fi; \
220 $(RC) tag $(NEW_VERSION); \
221 fi; \
222 fi; \
223 else \
224 echo Compiler version in gsc/_parms.scm is inconsistent with PACKAGE_VERSION; \
227 release: fake_target
228 $(MAKE) bootstrap
229 $(MAKE) clean
230 $(MAKE) all
231 $(MAKE) check
232 $(MAKE) doc
233 rm -f $(PACKAGE_TARNAME).tgz $(PACKAGE_TARNAME)-*.*
234 $(MAKE) prebuilt
236 publish-release: fake_target
237 misc/publish-release $(PACKAGE_VERSION) $(PACKAGE_TARNAME).tgz $(PACKAGE_TARNAME)-*.*
239 install-pre:
240 @if test "@ENABLE_SHARED@" = "yes" -a "@ENABLE_ABSOLUTE_SHARED_LIBS@" = "yes" -a "$(DESTDIR)" != ""; then \
241 echo "*** The use of --enable-shared and --enable-absolute-shared-libs is"; \
242 echo "*** incompatible with the use of DESTDIR. You can either specify an"; \
243 echo "*** empty DESTDIR or reconfigure with --disable-absolute-shared-libs."; \
244 exit 1; \
247 install-post: all
248 if test "@ENABLE_MULTIPLE_VERSIONS@" = "yes"; then \
249 if test "@bat@" = ""; then \
250 $(srcdirpfx)./mkidirs $(DESTDIR)$(prefix); \
251 rm -f $(DESTDIR)$(prefix)/../current \
252 $(DESTDIR)$(prefix)/../current.lnk; \
253 (cd $(DESTDIR)$(prefix)/.. && $(LN_S) $(PACKAGE_VERSION) current); \
254 fi; \
257 uninstall-pre:
259 uninstall-post:
260 if test "@ENABLE_MULTIPLE_VERSIONS@" = "yes"; then \
261 if test "@bat@" = ""; then \
262 (cd $(DESTDIR)$(prefix)/.. && \
263 rm -f current && \
264 rmdir $(PACKAGE_VERSION)); \
265 fi; \
268 mostlyclean-pre:
270 mostlyclean-post:
272 clean-pre: mostlyclean-pre
274 clean-post: mostlyclean-post
276 distclean-pre: clean-pre
278 distclean-post: clean-post
280 bootclean-pre: distclean-pre
282 bootclean-post: distclean-post
284 realclean-pre: bootclean-pre
286 realclean-post: bootclean-post
287 rm -f config.log config.status makefile
289 rc-setup-pre:
290 $(RC) init
291 @if test "$(RC)" = "$(GIT)"; then \
292 $(GIT) add $(RCFILES) $(GITRCFILES); \
293 rm -f .git/config; \
294 echo '[core]' >> .git/config; \
295 echo ' repositoryformatversion = 0' >> .git/config; \
296 echo ' fileMode = false' >> .git/config; \
297 echo ' bare = false' >> .git/config; \
298 echo ' logallrefupdates = true' >> .git/config; \
299 echo ' ignorecase = true' >> .git/config; \
300 echo ' autocrlf = false' >> .git/config; \
301 echo '[remote "origin"]' >> .git/config; \
302 echo ' url = http://www.iro.umontreal.ca/~gambit/repo/gambit.git/' >> .git/config; \
303 echo ' fetch = +refs/heads/*:refs/remotes/origin/*' >> .git/config; \
304 echo '[branch "master"]' >> .git/config; \
305 echo ' remote = origin' >> .git/config; \
306 echo ' merge = refs/heads/master' >> .git/config; \
307 else \
308 $(HG) add $(RCFILES) $(HGRCFILES); \
309 rm -f .hg/hgrc; \
310 echo "[paths]" > .hg/hgrc; \
311 echo "default-push = ssh://gambit@public-gambit-repo/HTML/repo/gambit" >> .hg/hgrc; \
312 echo "default = http://www.iro.umontreal.ca/~gambit/repo/gambit/" >> .hg/hgrc; \
315 rc-setup-post:
316 @if test "$(RC)" = "$(GIT)"; then \
317 $(GIT) commit -a -m "Initial commit of $(PACKAGE_STRING)"; \
318 else \
319 $(HG) commit -m "Initial commit of $(PACKAGE_STRING)"; \
322 dist-pre:
323 rm -rf $(PACKAGE_TARNAME)
324 mkdir $(PACKAGE_TARNAME)
325 chmod 777 $(PACKAGE_TARNAME)
326 @echo " Copying distribution files:"
327 @for file in $(DISTFILES); do \
328 echo " $$file"; \
329 ln $(srcdirpfx)$$file $(PACKAGE_TARNAME) 2> /dev/null \
330 || cp -p $(srcdirpfx)$$file $(PACKAGE_TARNAME); \
331 done
333 dist-post:
334 tar chof $(PACKAGE_TARNAME).tar $(PACKAGE_TARNAME)
335 gzip -9 $(PACKAGE_TARNAME).tar
336 mv $(PACKAGE_TARNAME).tar.gz $(PACKAGE_TARNAME).tgz
337 rm -rf $(PACKAGE_TARNAME)
339 dist-devel-pre:
340 rm -rf $(PACKAGE_TARNAME)
341 mkdir $(PACKAGE_TARNAME)
342 chmod 777 $(PACKAGE_TARNAME)
343 @echo " Copying distribution files:"
344 @for file in $(DISTFILES); do \
345 echo " $$file"; \
346 ln $(srcdirpfx)$$file $(PACKAGE_TARNAME) 2> /dev/null \
347 || cp -p $(srcdirpfx)$$file $(PACKAGE_TARNAME); \
348 done
349 @if test "$(RC)" = "$(GIT)"; then \
350 for file in $(GITDISTFILES); do \
351 echo " $$file"; \
352 ln $(srcdirpfx)$$file $(PACKAGE_TARNAME) 2> /dev/null \
353 || cp -p $(srcdirpfx)$$file $(PACKAGE_TARNAME); \
354 done; \
355 echo " .git"; \
356 ln $(srcdirpfx).git $(PACKAGE_TARNAME) 2> /dev/null \
357 || cp -p -R $(srcdirpfx).git $(PACKAGE_TARNAME); \
358 else \
359 for file in $(HGDISTFILES); do \
360 echo " $$file"; \
361 ln $(srcdirpfx)$$file $(PACKAGE_TARNAME) 2> /dev/null \
362 || cp -p $(srcdirpfx)$$file $(PACKAGE_TARNAME); \
363 done; \
364 echo " .hg"; \
365 ln $(srcdirpfx).hg $(PACKAGE_TARNAME) 2> /dev/null \
366 || cp -p -R $(srcdirpfx).hg $(PACKAGE_TARNAME); \
369 dist-devel-post:
370 rm -rf $(PACKAGE_TARNAME)-devel
371 mv $(PACKAGE_TARNAME) $(PACKAGE_TARNAME)-devel
372 tar chof $(PACKAGE_TARNAME)-devel.tar $(PACKAGE_TARNAME)-devel
373 gzip -9 $(PACKAGE_TARNAME)-devel.tar
374 mv $(PACKAGE_TARNAME)-devel.tar.gz $(PACKAGE_TARNAME)-devel.tgz
375 rm -rf $(PACKAGE_TARNAME)-devel
377 all-recursive install-recursive uninstall-recursive mostlyclean-recursive clean-recursive distclean-recursive bootclean-recursive realclean-recursive rc-setup-recursive dist-recursive dist-devel-recursive:
378 @for subdir in $(SUBDIRS); do \
379 target=`echo $@ | sed 's/-recursive//'`; \
380 echo making $$target in $$subdir; \
381 (cd $$subdir && $(MAKE) $$target) || exit 1; \
382 done
384 all: all-post
386 all-post: all-recursive
388 all-recursive: all-pre
390 install: install-post
392 install-post: install-recursive
394 install-recursive: install-pre
396 uninstall: uninstall-post
398 uninstall-post: uninstall-recursive
400 uninstall-recursive: uninstall-pre
402 mostlyclean: mostlyclean-post
404 mostlyclean-post: mostlyclean-recursive
406 mostlyclean-recursive: mostlyclean-pre
408 clean: clean-post
410 clean-post: clean-recursive
412 clean-recursive: clean-pre
414 distclean: distclean-post
416 distclean-post: distclean-recursive
418 distclean-recursive: distclean-pre
420 bootclean: bootclean-post
422 bootclean-post: bootclean-recursive
424 bootclean-recursive: bootclean-pre
426 realclean: realclean-post
428 realclean-post: realclean-recursive
430 realclean-recursive: realclean-pre
432 rc-setup: rc-setup-post
434 rc-setup-post: rc-setup-recursive
436 rc-setup-recursive: rc-setup-pre
438 dist: dist-post
440 dist-post: dist-recursive
442 dist-recursive: dist-pre
444 dist-devel: dist-devel-post
446 dist-devel-post: dist-devel-recursive
448 dist-devel-recursive: dist-devel-pre
450 # For an explanation of the following makefile rules, see node
451 # `Automatic Remaking' in GNU Autoconf documentation.
453 makefile: makefile.in config.status
454 CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
456 config.status: configure
457 ./config.status --recheck
459 configure: configure.ac
460 cd $(srcdir) && autoconf configure.ac > configure && chmod 755 configure
462 # Tell versions [3.59,3.63) of GNU make not to export all variables.
463 # Otherwise a system limit (for SysV at least) may be exceeded.
464 .NOEXPORT: