1 ## Process this file with Automake to create Makefile.in
3 ## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5 ## This file is part of GUILE.
7 ## GUILE is free software; you can redistribute it and/or modify it
8 ## under the terms of the GNU Lesser General Public License as
9 ## published by the Free Software Foundation; either version 3, or
10 ## (at your option) any later version.
12 ## GUILE is distributed in the hope that it will be useful, but
13 ## WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU Lesser General Public License for more details.
17 ## You should have received a copy of the GNU Lesser General Public
18 ## License along with GUILE; see the file COPYING.LESSER. If not,
19 ## write to the Free Software Foundation, Inc., 51 Franklin Street,
20 ## Fifth Floor, Boston, MA 02110-1301 USA
22 AUTOMAKE_OPTIONS = gnu
24 ## Prevent automake from adding extra -I options
27 # Override Automake's `DEFAULT_INCLUDES'. By default, it contains
28 # "-I$(srcdir)", which causes problems on Tru64 where our "random.h"
29 # is picked up by <stdlib.h> instead of the libc's <random.h>.
32 ## Check for headers in $(srcdir)/.., so that #include
33 ## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
34 ## building. Also look for Gnulib headers in `lib'.
35 AM_CPPFLAGS = -DBUILDING_LIBGUILE=1 -I$(top_srcdir) -I$(top_builddir) \
36 -I$(top_srcdir)/lib -I$(top_builddir)/lib
38 AM_CFLAGS = $(GCC_CFLAGS) $(CFLAG_VISIBILITY)
40 ## The Gnulib Libtool archive.
41 gnulib_library = $(top_builddir)/lib/libgnu.la
43 ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
44 --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
46 lib_LTLIBRARIES = libguile.la \
47 libguile-i18n-v-@LIBGUILE_I18N_MAJOR@.la
50 noinst_PROGRAMS = guile_filter_doc_snarfage gen-scmconfig
52 gen_scmconfig_SOURCES = gen-scmconfig.c
54 ## Override default rule; this should be compiled for BUILD host.
55 ## For some reason, OBJEXT does not include the dot
56 gen-scmconfig.$(OBJEXT): gen-scmconfig.c
57 if [ "$(cross_compiling)" = "yes" ]; then \
58 $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) -c -o $@ $<; \
60 $(COMPILE) -c -o $@ $<; \
63 ## Override default rule; this should run on BUILD host.
64 gen-scmconfig$(EXEEXT): $(gen_scmconfig_OBJECTS) $(gen_scmconfig_DEPENDENCIES)
65 @rm -f gen-scmconfig$(EXEEXT)
66 if [ "$(cross_compiling)" = "yes" ]; then \
67 $(CCLD_FOR_BUILD) -o $@ $(gen_scmconfig_OBJECTS); \
69 $(LINK) $(gen_scmconfig_OBJECTS) $(LDADD) $(LIBS); \
72 scmconfig.h: ${top_builddir}/config.h gen-scmconfig$(EXEEXT)
74 cat $(srcdir)/scmconfig.h.top > scmconfig.h.tmp
75 ./gen-scmconfig$(EXEEXT) >> scmconfig.h.tmp
76 chmod 444 scmconfig.h.tmp
78 mv scmconfig.h.tmp scmconfig.h
80 guile_filter_doc_snarfage_SOURCES = c-tokenize.c
82 ## Override default rule; this should be compiled for BUILD host.
83 ## For some reason, OBJEXT does not include the dot
84 c-tokenize.$(OBJEXT): c-tokenize.c
85 if [ "$(cross_compiling)" = "yes" ]; then \
86 $(CC_FOR_BUILD) $(DEFS) $(AM_CPPFLAGS) -c -o $@ $<; \
88 $(filter-out -Werror,$(COMPILE)) -c -o $@ $<; \
91 ## Override default rule; this should run on BUILD host.
92 guile_filter_doc_snarfage$(EXEEXT): $(guile_filter_doc_snarfage_OBJECTS) $(guile_filter_doc_snarfage_DEPENDENCIES)
93 @rm -f guile_filter_doc_snarfage$(EXEEXT)
94 if [ "$(cross_compiling)" = "yes" ]; then \
95 $(CCLD_FOR_BUILD) -o $@ $(guile_filter_doc_snarfage_OBJECTS); \
97 $(LINK) $(guile_filter_doc_snarfage_OBJECTS) $(LDADD) $(LIBS); \
101 guile_SOURCES = guile.c
102 guile_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
103 guile_LDADD = libguile.la
104 guile_LDFLAGS = $(GUILE_CFLAGS)
106 libguile_la_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
108 libguile_la_SOURCES = \
146 generalized-arrays.c \
147 generalized-vectors.c \
212 libguile_i18n_v_@LIBGUILE_I18N_MAJOR@_la_SOURCES = i18n.c
213 libguile_i18n_v_@LIBGUILE_I18N_MAJOR@_la_CFLAGS = \
214 $(libguile_la_CFLAGS)
215 libguile_i18n_v_@LIBGUILE_I18N_MAJOR@_la_LIBADD = \
216 libguile.la $(gnulib_library)
217 libguile_i18n_v_@LIBGUILE_I18N_MAJOR@_la_LDFLAGS = \
218 -module -L$(builddir) -lguile \
219 -version-info @LIBGUILE_I18N_INTERFACE@
256 generalized-arrays.x \
257 generalized-vectors.x \
318 DOT_X_FILES += frames.x instructions.x objcodes.x programs.x vm.x
320 EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
353 gc-segment-table.doc \
357 generalized-arrays.doc \
358 generalized-vectors.doc \
418 EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
420 DOT_I_FILES = vm-i-system.i vm-i-scheme.i vm-i-loader.i
423 grep '^VM_DEFINE' $< > $@
425 BUILT_SOURCES = cpp_err_symbols.c cpp_sig_symbols.c libpath.h \
426 version.h scmconfig.h \
427 $(DOT_I_FILES) $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
429 EXTRA_libguile_la_SOURCES = _scm.h \
430 inet_aton.c memmove.c putenv.c strerror.c \
431 dynl.c regex-posix.c \
432 filesys.c posix.c net_db.c socket.c \
433 debug-malloc.c mkstemp.c \
434 win32-uname.c win32-dirent.c win32-socket.c \
437 ## delete guile-snarf.awk from the installation bindir, in case it's
438 ## lingering there due to an earlier guile version not having been
441 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
443 ## This is kind of nasty... there are ".c" files that we don't want to
444 ## compile, since they are #included. So instead we list them here.
445 ## Perhaps we can deal with them normally once the merge seems to be
447 noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
448 eval.i.c ieee-754.h \
451 win32-uname.h win32-dirent.h win32-socket.h \
452 private-gc.h private-options.h
455 noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
457 libguile_la_DEPENDENCIES = @LIBLOBJS@
458 libguile_la_LIBADD = @LIBLOBJS@ $(gnulib_library)
459 libguile_la_LDFLAGS = @LTLIBINTL@ -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ -export-dynamic -no-undefined
461 # These are headers visible as <guile/mumble.h>
464 # These are headers visible as <libguile/mumble.h>.
465 modincludedir = $(includedir)/libguile
466 modinclude_HEADERS = \
502 generalized-arrays.h \
503 generalized-vectors.h \
580 nodist_modinclude_HEADERS = version.h scmconfig.h
582 bin_SCRIPTS = guile-snarf
584 # We can re-enable install for some of these if/when they are documented
585 # and people feel like maintaining them. For now, this is not the case.
586 noinst_SCRIPTS = guile-doc-snarf guile-snarf-docs guile-func-name-check
588 EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
589 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 cpp_signal.c \
590 cpp_errno.c cpp_err_symbols.in cpp_err_symbols.c \
591 cpp_sig_symbols.c cpp_sig_symbols.in cpp_cnvt.awk \
592 c-tokenize.lex version.h.in \
593 scmconfig.h.top libgettext.h
594 # $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
595 # guile-procedures.txt guile.texi
597 ## We use @-...-@ as the substitution brackets here, instead of the
598 ## usual @...@, so autoconf doesn't go and substitute the values
599 ## directly into the left-hand sides of the sed substitutions. *sigh*
600 version.h: version.h.in
601 sed < $(srcdir)/version.h.in > $@.tmp \
602 -e s:@-GUILE_MAJOR_VERSION-@:${GUILE_MAJOR_VERSION}: \
603 -e s:@-GUILE_MINOR_VERSION-@:${GUILE_MINOR_VERSION}: \
604 -e s:@-GUILE_MICRO_VERSION-@:${GUILE_MICRO_VERSION}:
607 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
608 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
609 @echo "Generating libpath.h..."
611 @echo '/* generated by Makefile */' > libpath.tmp
612 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
613 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
614 @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
615 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
616 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
617 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
618 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
619 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
620 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
621 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
622 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
623 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
624 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
625 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
626 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
627 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
628 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
629 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
630 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
631 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
632 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
633 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
634 @echo ' { "pkgdatadir", "@pkgdatadir@" }, \' >> libpath.tmp
635 @echo ' { "pkglibdir", "@pkglibdir@" }, \' >> libpath.tmp
636 @echo ' { "pkgincludedir", "@pkgincludedir@" }, \' \
638 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
639 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
641 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
642 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
643 @echo ' { "buildstamp", "'"`date`"'" }, \' >> libpath.tmp
644 @echo '}' >> libpath.tmp
645 @mv libpath.tmp libpath.h
648 snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
652 ./guile-snarf -o $@ $< $(snarfcppopts)
654 -$(AWK) -f ./guile-func-name-check $<
655 (./guile-snarf-docs $(snarfcppopts) $< | \
656 ./guile_filter_doc_snarfage$(EXEEXT) --filter-snarfage) > $@ || { rm $@; false; }
658 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in
660 $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
662 error.x: cpp_err_symbols.c
663 posix.x: cpp_sig_symbols.c
666 alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
667 snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guile-tools snarf-check-and-output-texi
668 dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
670 guile.texi: $(alldotdocfiles) guile$(EXEEXT)
671 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
673 guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
674 $(dotdoc2texi) > $@ || { rm $@; false; }
678 guile-procedures.txt: guile-procedures.texi
680 makeinfo --force -o $@ guile-procedures.texi || test -f $@
684 guile-procedures.txt: guile-procedures.texi
685 cp guile-procedures.texi $@
689 c-tokenize.c: c-tokenize.lex
690 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
692 schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
693 schemelib_DATA = guile-procedures.txt
695 ## Add -MG to make the .x magic work with auto-dep code.
696 MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
698 cpp_err_symbols.c: cpp_err_symbols.in cpp_cnvt.awk
699 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \
701 mv cpp_err_symbols.tmp cpp_err_symbols.c
703 cpp_sig_symbols.c: cpp_sig_symbols.in cpp_cnvt.awk
704 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_sig_symbols.in > \
706 mv cpp_sig_symbols.tmp cpp_sig_symbols.c
708 ## Create a new version of the cpp_sig_symbols.in file, including all SIGXXX
709 ## macros defined on this platform.
711 gcc -undef -dM -E $(srcdir)/cpp_signal.c | egrep ' SIG[A-Z]+' \
712 | cut -f2 -d' ' | sort > cpp_sig_symbols_here
713 diff -u $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_here \
715 | cut -c2- > cpp_sig_symbols_diff
716 if test -s cpp_sig_symbols_diff ; then \
717 cat $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_diff \
718 | sort > cpp_sig_symbols_new ;\
719 echo "cpp_sig_symbols_new has the following additions:" ;\
720 cat cpp_sig_symbols_diff ;\
721 else echo "No new symbols found."; \
724 ## Likewise for cpp_err_symbols.in.
726 gcc -undef -dM -E $(srcdir)/cpp_errno.c | egrep ' E.+' \
727 | cut -f2 -d' ' | sort > cpp_err_symbols_here
728 diff -u $(srcdir)/cpp_err_symbols.in cpp_err_symbols_here \
730 | cut -c2- > cpp_err_symbols_diff
731 if test -s cpp_err_symbols_diff ; then \
732 cat $(srcdir)/cpp_err_symbols.in cpp_err_symbols_diff \
733 | sort > cpp_err_symbols_new ;\
734 echo "cpp_err_symbols_new has the following additions:" ;\
735 cat cpp_err_symbols_diff ;\
736 else echo "No new symbols found."; \
740 cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
741 cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new \
742 version.h version.h.tmp \
743 scmconfig.h scmconfig.h.tmp
745 CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi \
748 MAINTAINERCLEANFILES = c-tokenize.c