1 # makefile for Gambit-C system.
3 # Copyright (c) 1994-2012 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
)
90 BUILD_FARM
= localhost
91 #BUILD_HOST = baro.iro.umontreal.ca
92 BUILD_HOST
= localhost
101 test -f
"gsc-comp@exe@" || cp gsc
/gsc@exe@ gsc-comp@exe@
105 doc
info pdf html txt
: fake_target
106 cd doc
&& $(MAKE
) $(MDEFINES
) $@
108 bootstrap
: fake_target
all
109 cp gsc
/gsc@exe@ gsc-comp@exe@
111 check: fake_target
all
112 cd tests
&& $(MAKE
) $(MDEFINES
) $@
114 examples
: fake_target
all
115 cd examples
&& $(MAKE
) $(MDEFINES
) $@
117 prebuilt
: dist dist-devel
118 PATH
="gsi:$$PATH" prebuilt
/remote-connect
$(BUILD_FARM
) "" "(define tmpdir \"gambtmp0\")(define gambc-dist \"$(PACKAGE_TARNAME)\")(define timeout 600)(ssh timeout (string-append \"rm -rf \" tmpdir \";mkdir \" tmpdir \";echo 'logged in on:';hostname\"))(scp-to timeout (string-append gambc-dist \".tgz\") (string-append tmpdir \"/.\"))(ssh timeout (string-append \"ssh $(BUILD_HOST) 'cd \" tmpdir \";tar zxf \" gambc-dist \".tgz;cd \" gambc-dist \";./configure;make -j 4;mv ../\" gambc-dist \".tgz .;cd prebuilt;make prebuilt'\"))(scp-from timeout (string-append tmpdir \"/\" gambc-dist \"/$(PACKAGE_TARNAME)-*\") \".\")"
119 @
# cd prebuilt && $(MAKE) $(MDEFINES) $@
122 cd
include && $(MAKE
) $(MDEFINES
) $@
124 commit
: fake_target stamp
125 @if
test "$(RC)" = "$(GIT)"; then \
141 @if
test "$(RC)" = "$(GIT)"; then \
142 $(GIT
) push ssh
://gambit@frontal07.iro.umontreal.ca
/~
/HTML
/repo
/gambit.git
/; \
148 @if
test "$(RC)" = "$(GIT)"; then \
150 $(GIT
) fetch
--tags; \
155 update-nopull
: fake_target
156 @if
test "$(RC)" = "$(GIT)"; then \
157 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;}'`; \
159 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;}'`; \
161 if
test "$$next_version" = ""; then \
162 if
test "$(RC)" = "$(GIT)"; then \
163 $(GIT
) checkout master
; \
168 $(RC
) checkout
$$next_version-bootstrap
; \
170 $(RC
) checkout
$$next_version; \
171 $(MAKE
) bootclean bootstrap update
; \
174 update
: pull update-nopull
177 new-major
: fake_target
178 major
=`echo $(PACKAGE_VERSION) | sed -e "s/v//g" -e "s/\.[^.]*\.[^.]*//g"`; \
179 next_major
=`eval expr 1 + $$major`; \
180 next_version
=v
$$next_major.0.0; \
181 $(MAKE
) NEW_VERSION
=$$next_version change-version
183 new-minor
: fake_target
184 major
=`echo $(PACKAGE_VERSION) | sed -e "s/v//g" -e "s/\.[^.]*\.[^.]*//g"`; \
185 minor
=`echo $(PACKAGE_VERSION) | sed -e "s/v[^.]*\.//g" -e "s/\.[^.]*//g"`; \
186 next_minor
=`eval expr 1 + $$minor`; \
187 next_version
=v
$$major.
$$next_minor.0; \
188 $(MAKE
) NEW_VERSION
=$$next_version change-version
190 new-revision
: fake_target
191 major
=`echo $(PACKAGE_VERSION) | sed -e "s/v//g" -e "s/\.[^.]*\.[^.]*//g"`; \
192 minor
=`echo $(PACKAGE_VERSION) | sed -e "s/v[^.]*\.//g" -e "s/\.[^.]*//g"`; \
193 revision
=`echo $(PACKAGE_VERSION) | sed -e "s/v[^.]*\.[^.]*\.//g" -e "s///g"`; \
194 next_revision
=`eval expr 1 + $$revision`; \
195 next_version
=v
$$major.
$$minor.
$$next_revision; \
196 $(MAKE
) NEW_VERSION
=$$next_version change-version
198 change-version
: fake_target
199 major
=`echo $(PACKAGE_VERSION) | sed -e "s/v//g" -e "s/\.[^.]*\.[^.]*//g"`; \
200 minor
=`echo $(PACKAGE_VERSION) | sed -e "s/v[^.]*\.//g" -e "s/\.[^.]*//g"`; \
201 revision
=`echo $(PACKAGE_VERSION) | sed -e "s/v[^.]*\.[^.]*\.//g" -e "s///g"`; \
202 next_major
=`echo $(NEW_VERSION) | sed -e "s/v//g" -e "s/\.[^.]*\.[^.]*//g"`; \
203 next_minor
=`echo $(NEW_VERSION) | sed -e "s/v[^.]*\.//g" -e "s/\.[^.]*//g"`; \
204 next_revision
=`echo $(NEW_VERSION) | sed -e "s/v[^.]*\.[^.]*\.//g" -e "s///g"`; \
205 version_num
=`eval expr "\( 100000 \\* $$major \) + \( 1000 \\* $$minor \) + $$revision"`; \
206 new_version_num
=`eval expr "\( 100000 \\* $$next_major \) + \( 1000 \\* $$next_minor \) + $$next_revision"`; \
207 sed
-e
"/(define (compiler-version) $$version_num)/s/$$version_num/$$new_version_num/" gsc
/_parms.scm
> gsc
/_parms.scm-new
; \
208 if
! diff gsc
/_parms.scm gsc
/_parms.scm-new
> /dev
/null
; then \
209 mv gsc
/_parms.scm-new gsc
/_parms.scm
; \
210 if
test "$(RC)" = "$(GIT)"; then \
211 $(GIT
) commit
-a
-m
"[COMPILER CHANGES NEEDED FOR $(NEW_VERSION)] Changed version in compiler"; \
213 $(HG
) commit
-m
"[COMPILER CHANGES NEEDED FOR $(NEW_VERSION)] Changed version in compiler"; \
215 $(RC
) tag
$(NEW_VERSION
)-bootstrap
; \
216 if
$(MAKE
) bootstrap
; then \
217 misc
/changev
$$version_num $$new_version_num; \
218 touch doc
/gambit-c.txi
; \
219 cd tests
; @SETDLPATH@ ..
/gsc
/gsc
-:~~bin
=..
/bin
,~~lib
=..
/lib
,~~
include=..
/include -f
-c mix.scm
; mv mix.c test5.ok
; cd ..
; \
220 if
$(MAKE
) bootclean
&& $(MAKE
) -j
2 && $(MAKE
) check && $(MAKE
) doc
; then \
221 if
test "$(RC)" = "$(GIT)"; then \
222 $(GIT
) commit
-a
-m
"[RUNTIME CHANGES NEEDED FOR $(NEW_VERSION)] Changed version of runtime using misc/changev"; \
224 $(HG
) commit
-m
"[RUNTIME CHANGES NEEDED FOR $(NEW_VERSION)] Changed version of runtime using misc/changev"; \
226 $(RC
) tag
$(NEW_VERSION
); \
230 echo Compiler version in gsc
/_parms.scm is inconsistent with PACKAGE_VERSION
; \
239 rm -f
$(PACKAGE_TARNAME
).tgz
$(PACKAGE_TARNAME
)-*.
*
242 publish-release
: fake_target
243 misc
/publish-release
$(PACKAGE_VERSION
) $(PACKAGE_TARNAME
).tgz
$(PACKAGE_TARNAME
)-*.
*
246 @if
test "@ENABLE_SHARED@" = "yes" -a
"@ENABLE_ABSOLUTE_SHARED_LIBS@" = "yes" -a
"$(DESTDIR)" != ""; then \
247 echo
"*** The use of --enable-shared and --enable-absolute-shared-libs is"; \
248 echo
"*** incompatible with the use of DESTDIR. You can either specify an"; \
249 echo
"*** empty DESTDIR or reconfigure with --disable-absolute-shared-libs."; \
254 if
test "@ENABLE_MULTIPLE_VERSIONS@" = "yes"; then \
255 if
test "@bat@" = ""; then \
256 $(srcdirpfx
).
/mkidirs
$(DESTDIR
)$(prefix); \
257 rm -f
$(DESTDIR
)$(prefix)/..
/current \
258 $(DESTDIR
)$(prefix)/..
/current.lnk
; \
259 (cd
$(DESTDIR
)$(prefix)/..
&& $(LN_S
) $(PACKAGE_VERSION
) current
); \
266 if
test "@ENABLE_MULTIPLE_VERSIONS@" = "yes"; then \
267 if
test "@bat@" = ""; then \
268 (cd
$(DESTDIR
)$(prefix)/..
&& \
270 rmdir
$(PACKAGE_VERSION
)); \
278 clean-pre
: mostlyclean-pre
280 clean-post
: mostlyclean-post
282 distclean-pre
: clean-pre
284 distclean-post
: clean-post
286 bootclean-pre
: distclean-pre
288 bootclean-post
: distclean-post
290 realclean-pre
: bootclean-pre
292 realclean-post
: bootclean-post
293 rm -f config.log config.status makefile
297 @if
test "$(RC)" = "$(GIT)"; then \
298 $(GIT
) add
$(RCFILES
) $(GITRCFILES
); \
300 echo
'[core]' >> .git
/config
; \
301 echo
' repositoryformatversion = 0' >> .git
/config
; \
302 echo
' fileMode = false' >> .git
/config
; \
303 echo
' bare = false' >> .git
/config
; \
304 echo
' logallrefupdates = true' >> .git
/config
; \
305 echo
' ignorecase = true' >> .git
/config
; \
306 echo
' autocrlf = false' >> .git
/config
; \
307 echo
'[remote "origin"]' >> .git
/config
; \
308 echo
' url = ssh://gambit@frontal07.iro.umontreal.ca/~/HTML/repo/gambit.git' >> .git
/config
; \
309 echo
' fetch = +refs/heads/*:refs/remotes/origin/*' >> .git
/config
; \
310 echo
'[branch "master"]' >> .git
/config
; \
311 echo
' remote = origin' >> .git
/config
; \
312 echo
' merge = refs/heads/master' >> .git
/config
; \
314 $(HG
) add
$(RCFILES
) $(HGRCFILES
); \
316 echo
"[paths]" > .hg
/hgrc
; \
317 echo
"default-push = ssh://gambit@frontal07.iro.umontreal.ca/HTML/repo/gambit" >> .hg
/hgrc
; \
318 echo
"default = http://www.iro.umontreal.ca/~gambit/repo/gambit/" >> .hg
/hgrc
; \
322 @if
test "$(RC)" = "$(GIT)"; then \
323 $(GIT
) commit
-a
-m
"Initial commit of $(PACKAGE_STRING)"; \
325 $(HG
) commit
-m
"Initial commit of $(PACKAGE_STRING)"; \
329 rm -rf
$(PACKAGE_TARNAME
)
330 mkdir
$(PACKAGE_TARNAME
)
331 chmod
777 $(PACKAGE_TARNAME
)
332 @echo
" Copying distribution files:"
333 @for file in
$(DISTFILES
); do \
335 ln
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
) 2> /dev
/null \
336 || cp
-p
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
); \
340 tar chof
$(PACKAGE_TARNAME
).
tar $(PACKAGE_TARNAME
)
341 gzip
-9 $(PACKAGE_TARNAME
).
tar
342 mv
$(PACKAGE_TARNAME
).
tar.gz
$(PACKAGE_TARNAME
).tgz
343 rm -rf
$(PACKAGE_TARNAME
)
346 rm -rf
$(PACKAGE_TARNAME
)
347 mkdir
$(PACKAGE_TARNAME
)
348 chmod
777 $(PACKAGE_TARNAME
)
349 @echo
" Copying distribution files:"
350 @for file in
$(DISTFILES
); do \
352 ln
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
) 2> /dev
/null \
353 || cp
-p
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
); \
355 @if
test "$(RC)" = "$(GIT)"; then \
356 for file in
$(GITDISTFILES
); do \
358 ln
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
) 2> /dev
/null \
359 || cp
-p
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
); \
362 ln
$(srcdirpfx
).git
$(PACKAGE_TARNAME
) 2> /dev
/null \
363 || cp
-p
-R
$(srcdirpfx
).git
$(PACKAGE_TARNAME
); \
365 for file in
$(HGDISTFILES
); do \
367 ln
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
) 2> /dev
/null \
368 || cp
-p
$(srcdirpfx
)$$file $(PACKAGE_TARNAME
); \
371 ln
$(srcdirpfx
).hg
$(PACKAGE_TARNAME
) 2> /dev
/null \
372 || cp
-p
-R
$(srcdirpfx
).hg
$(PACKAGE_TARNAME
); \
376 rm -rf
$(PACKAGE_TARNAME
)-devel
377 mv
$(PACKAGE_TARNAME
) $(PACKAGE_TARNAME
)-devel
378 tar chof
$(PACKAGE_TARNAME
)-devel.
tar $(PACKAGE_TARNAME
)-devel
379 gzip
-9 $(PACKAGE_TARNAME
)-devel.
tar
380 mv
$(PACKAGE_TARNAME
)-devel.
tar.gz
$(PACKAGE_TARNAME
)-devel.tgz
381 rm -rf
$(PACKAGE_TARNAME
)-devel
383 all-recursive install-recursive uninstall-recursive mostlyclean-recursive clean-recursive distclean-recursive bootclean-recursive realclean-recursive rc-setup-recursive dist-recursive dist-devel-recursive
:
384 @for subdir in
$(SUBDIRS
); do \
385 target
=`echo $@ | sed 's/-recursive//'`; \
386 echo making
$$target in
$$subdir; \
387 (cd
$$subdir && $(MAKE
) $$target) || exit
1; \
392 all-post
: all-recursive
394 all-recursive
: all-pre
396 install: install-post
398 install-post
: install-recursive
400 install-recursive
: install-pre
402 uninstall: uninstall-post
404 uninstall-post
: uninstall-recursive
406 uninstall-recursive
: uninstall-pre
408 mostlyclean: mostlyclean-post
410 mostlyclean-post
: mostlyclean-recursive
412 mostlyclean-recursive
: mostlyclean-pre
416 clean-post
: clean-recursive
418 clean-recursive
: clean-pre
420 distclean: distclean-post
422 distclean-post
: distclean-recursive
424 distclean-recursive
: distclean-pre
426 bootclean
: bootclean-post
428 bootclean-post
: bootclean-recursive
430 bootclean-recursive
: bootclean-pre
432 realclean: realclean-post
434 realclean-post
: realclean-recursive
436 realclean-recursive
: realclean-pre
438 rc-setup
: rc-setup-post
440 rc-setup-post
: rc-setup-recursive
442 rc-setup-recursive
: rc-setup-pre
446 dist-post
: dist-recursive
448 dist-recursive
: dist-pre
450 dist-devel
: dist-devel-post
452 dist-devel-post
: dist-devel-recursive
454 dist-devel-recursive
: dist-devel-pre
456 # For an explanation of the following makefile rules, see node
457 # `Automatic Remaking' in GNU Autoconf documentation.
459 makefile
: makefile.in config.status
460 CONFIG_FILES
=$@ CONFIG_HEADERS
= .
/config.status
462 config.status
: configure
463 .
/config.status
--recheck
465 configure
: configure.ac
466 cd
$(srcdir) && autoconf configure.ac
> configure
&& chmod
755 configure
468 # Tell versions [3.59,3.63) of GNU make not to export all variables.
469 # Otherwise a system limit (for SysV at least) may be exceeded.