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@
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@
27 GAMBCLIB_DEFS
= @GAMBCLIB_DEFS_MF@
28 LIB_PREFIX
= @LIB_PREFIX@
29 LIB_EXTENSION
= @LIB_EXTENSION@
31 GAMBCGSCLIB
= @GAMBCGSCLIB@
32 GAMBCGSILIB
= @GAMBCGSILIB@
34 INSTALL_DATA
= @INSTALL_DATA@
35 INSTALL_LIB
= @INSTALL_LIB@
36 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
44 exec_prefix = @
exec_prefix@
45 includedir = @
includedir@
51 libexecdir
= @libexecdir@
52 datarootdir
= @datarootdir@
58 localedir
= @localedir@
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 \
79 GITRCFILES
= .gitignore .gitattributes
80 HGRCFILES
= .hgignore .hgtags
84 DISTFILES
= $(RCFILES
) $(GENDISTFILES
)
86 GITDISTFILES
= $(GITRCFILES
)
87 HGDISTFILES
= $(HGRCFILES
)
96 test -f
"gsc-comp@exe@" || cp gsc
/gsc@exe@ gsc-comp@exe@
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
) $@
116 cd
include && $(MAKE
) $(MDEFINES
) $@
118 commit
: fake_target stamp
119 @if
test "$(RC)" = "$(GIT)"; then \
135 @if
test "$(RC)" = "$(GIT)"; then \
136 $(GIT
) push ssh
://gambit@public-gambit-repo
/~
/HTML
/repo
/gambit.git
/; \
142 @if
test "$(RC)" = "$(GIT)"; then \
144 $(GIT
) fetch
--tags; \
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;}'`; \
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;}'`; \
155 if
test "$$next_version" = ""; then \
156 if
test "$(RC)" = "$(GIT)"; then \
157 $(GIT
) checkout master
; \
162 $(RC
) checkout
$$next_version-bootstrap
; \
164 $(RC
) checkout
$$next_version; \
165 $(MAKE
) bootclean bootstrap update
; \
168 update
: pull update-nopull
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"; \
207 $(HG
) commit
-m
"[COMPILER CHANGES NEEDED FOR $(NEW_VERSION)] Changed version in compiler"; \
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"; \
218 $(HG
) commit
-m
"[RUNTIME CHANGES NEEDED FOR $(NEW_VERSION)] Changed version of runtime using misc/changev"; \
220 $(RC
) tag
$(NEW_VERSION
); \
224 echo Compiler version in gsc
/_parms.scm is inconsistent with PACKAGE_VERSION
; \
233 rm -f
$(PACKAGE_TARNAME
).tgz
$(PACKAGE_TARNAME
)-*.
*
236 publish-release
: fake_target
237 misc
/publish-release
$(PACKAGE_VERSION
) $(PACKAGE_TARNAME
).tgz
$(PACKAGE_TARNAME
)-*.
*
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."; \
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
); \
260 if
test "@ENABLE_MULTIPLE_VERSIONS@" = "yes"; then \
261 if
test "@bat@" = ""; then \
262 (cd
$(DESTDIR
)$(prefix)/..
&& \
264 rmdir
$(PACKAGE_VERSION
)); \
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
291 @if
test "$(RC)" = "$(GIT)"; then \
292 $(GIT
) add
$(RCFILES
) $(GITRCFILES
); \
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
; \
308 $(HG
) add
$(RCFILES
) $(HGRCFILES
); \
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
; \
316 @if
test "$(RC)" = "$(GIT)"; then \
317 $(GIT
) commit
-a
-m
"Initial commit of $(PACKAGE_STRING)"; \
319 $(HG
) commit
-m
"Initial commit of $(PACKAGE_STRING)"; \
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 \
329 ln
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
) 2> /dev
/null \
330 || cp
-p
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
); \
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
)
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 \
346 ln
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
) 2> /dev
/null \
347 || cp
-p
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
); \
349 @if
test "$(RC)" = "$(GIT)"; then \
350 for file in
$(GITDISTFILES
); do \
352 ln
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
) 2> /dev
/null \
353 || cp
-p
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
); \
356 ln
$(srcdirpfx
).git
$(PACKAGE_TARNAME
) 2> /dev
/null \
357 || cp
-p
-R
$(srcdirpfx
).git
$(PACKAGE_TARNAME
); \
359 for file in
$(HGDISTFILES
); do \
361 ln
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
) 2> /dev
/null \
362 || cp
-p
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
); \
365 ln
$(srcdirpfx
).hg
$(PACKAGE_TARNAME
) 2> /dev
/null \
366 || cp
-p
-R
$(srcdirpfx
).hg
$(PACKAGE_TARNAME
); \
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; \
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
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
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.