* Makefile.am (DEFS): Added. automake adds -I options to DEFS,
[bpt/guile.git] / libguile / Makefile.am
1 ## Process this file with Automake to create Makefile.in
2 ##
3 ## Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
4 ##
5 ## This file is part of GUILE.
6 ##
7 ## GUILE is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as
9 ## published by the Free Software Foundation; either version 2, or
10 ## (at your option) any later version.
11 ##
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 General Public License for more details.
16 ##
17 ## You should have received a copy of the GNU General Public
18 ## License along with GUILE; see the file COPYING. If not, write
19 ## to the Free Software Foundation, Inc., 59 Temple Place, Suite
20 ## 330, Boston, MA 02111-1307 USA
21
22 AUTOMAKE_OPTIONS = foreign
23
24 ## Prevent automake from adding extra -I options
25 DEFS = @DEFS@
26 ## Check for headers in $(srcdir)/.., so that #include
27 ## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
28 ## building.
29 INCLUDES = -I.. -I$(srcdir)/..
30
31 ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
32 --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
33
34 lib_LTLIBRARIES = libguile.la
35 bin_PROGRAMS = guile
36
37 guile_SOURCES = guile.c
38 guile_LDADD = libguile.la ${THREAD_LIBS_LOCAL}
39 guile_LDFLAGS = @DLPREOPEN@
40
41 libguile_la_SOURCES = \
42 alist.c arbiters.c async.c backtrace.c boolean.c chars.c \
43 continuations.c debug.c dynl.c dynwind.c eq.c error.c eval.c \
44 evalext.c feature.c fluids.c fports.c gc.c gdbint.c \
45 gh_data.c gh_eval.c gh_funcs.c gh_init.c gh_io.c gh_list.c \
46 gh_predicates.c gsubr.c guardians.c hash.c hashtab.c init.c \
47 ioext.c iselect.c keywords.c lang.c list.c load.c macros.c mallocs.c \
48 modules.c numbers.c objects.c objprop.c options.c pairs.c \
49 ports.c print.c procprop.c procs.c random.c read.c \
50 root.c scmsigs.c script.c simpos.c smob.c sort.c \
51 srcprop.c stackchk.c stacks.c stime.c strings.c strop.c strorder.c \
52 strports.c struct.c symbols.c tag.c throw.c variable.c \
53 vectors.c version.c vports.c weaks.c
54
55 DOT_X_FILES = \
56 cpp_err_symbols.c cpp_sig_symbols.c libpath.h alist.x arbiters.x \
57 async.x backtrace.x boolean.x chars.x continuations.x debug.x \
58 dynl.x dynwind.x eq.x error.x eval.x evalext.x feature.x filesys.x \
59 fluids.x fports.x gc.x gsubr.x \
60 guardians.x hash.x hashtab.x init.x ioext.x iselect.x keywords.x \
61 lang.x list.x load.x macros.x mallocs.x modules.x net_db.x \
62 numbers.x objects.x objprop.x options.x pairs.x ports.x posix.x \
63 print.x procprop.x procs.x random.x ramap.x read.x regex-posix.x \
64 root.x scmsigs.x script.x simpos.x smob.x socket.x sort.x \
65 srcprop.x stackchk.x stacks.x stime.x strings.x strop.x strorder.x \
66 strports.x struct.x symbols.x tag.x threads.x throw.x unif.x \
67 variable.x vectors.x version.x vports.x weaks.x debug-malloc.x
68
69 DOT_DOC_FILES = $(DOT_X_FILES:.x=.doc)
70
71 BUILT_SOURCES = $(DOT_X_FILES) $(DOT_DOC_FILES)
72
73 EXTRA_libguile_la_SOURCES = _scm.h \
74 alloca.c inet_aton.c memmove.c putenv.c strerror.c \
75 threads.c regex-posix.c \
76 filesys.c posix.c net_db.c socket.c \
77 ramap.c unif.c debug-malloc.c
78
79 ## This is kind of nasty... there are ".c" files that we don't want to
80 ## compile, since they are #included in threads.c. So instead we list
81 ## them here. Perhaps we can deal with them normally once the merge
82 ## seems to be working.
83 noinst_HEADERS = coop-threads.c coop-threads.h coop.c
84
85 libguile_la_DEPENDENCIES = @LIBLOBJS@
86 libguile_la_LIBADD = @LIBLOBJS@ $(LIBLTDL)
87 libguile_la_LDFLAGS = -version-info 8:0 -export-dynamic
88
89 include_HEADERS = libguile.h
90
91 # These are headers visible as <guile/mumble.h>
92 pkginclude_HEADERS = gh.h
93
94 # These are headers visible as <libguile/mumble.h>.
95 modincludedir = $(includedir)/libguile
96 modinclude_HEADERS = \
97 __scm.h alist.h arbiters.h async.h backtrace.h boolean.h chars.h \
98 continuations.h debug.h dynl.h dynwind.h eq.h error.h eval.h \
99 evalext.h feature.h filesys.h fports.h gc.h gdb_interface.h \
100 gdbint.h gsubr.h guardians.h hash.h hashtab.h init.h \
101 ioext.h keywords.h kw.h lang.h list.h load.h macros.h mallocs.h \
102 modules.h net_db.h numbers.h objects.h objprop.h options.h pairs.h \
103 ports.h posix.h regex-posix.h print.h procprop.h procs.h random.h \
104 ramap.h read.h root.h scmsigs.h validate.h script.h simpos.h smob.h socket.h \
105 sort.h srcprop.h stackchk.h stacks.h stime.h strings.h strop.h \
106 strorder.h strports.h struct.h symbols.h tag.h tags.h throw.h \
107 unif.h variable.h vectors.h version.h vports.h weaks.h snarf.h \
108 threads.h coop-defs.h fluids.h iselect.h debug-malloc.h
109
110 ## This file is generated at configure time. That is why it is DATA
111 ## and not a header -- headers are included in the distribution.
112 modinclude_DATA = scmconfig.h
113
114 bin_SCRIPTS = guile-snarf guile-doc-snarf guile-snarf.awk guile-func-name-check
115
116 check_ldadd = libguile.la ${THREAD_LIBS_LOCAL}
117 check_PROGRAMS = gh_test_c gh_test_repl
118 gh_test_c_SOURCES = gh_test_c.c
119 gh_test_c_LDADD = ${check_ldadd}
120 gh_test_repl_SOURCES = gh_test_repl.c
121 gh_test_repl_LDADD = ${check_ldadd}
122
123 check-local:
124 echo '(+ 1 2 3)' | GUILE_LOAD_PATH=${top_srcdir}:.. ./gh_test_c; echo
125 echo '(+ 1 2 3)' | GUILE_LOAD_PATH=${top_srcdir}:.. ./gh_test_repl; echo
126
127 EXTRA_DIST = ChangeLog-gh ChangeLog-scm ChangeLog-threads cpp_signal.c \
128 cpp_errno.c cpp_err_symbols.in cpp_sig_symbols.in cpp_cnvt.awk \
129 coop-threads.h.cygnus coop-threads.c.cygnus mit-pthreads.h \
130 mit-pthreads.c fsu-pthreads.h
131
132 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
133 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
134 @echo "Generating libpath.h..."
135 @rm -f libpath.tmp
136 @echo '/* generated by Makefile */' > libpath.tmp
137 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
138 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(VERSION)"'>>libpath.tmp
139 @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
140 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
141 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
142 @echo ' { "top_srcdir", "'"`cd @top_srcdir@; pwd`"'" }, \' \
143 >> libpath.tmp
144 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
145 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
146 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
147 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
148 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
149 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
150 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
151 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
152 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
153 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
154 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
155 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
156 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
157 @echo ' { "pkgdatadir", "$(datadir)/@PACKAGE@" }, \' >> libpath.tmp
158 @echo ' { "pkglibdir", "$(libdir)/@PACKAGE@" }, \' >> libpath.tmp
159 @echo ' { "pkgincludedir", "$(includedir)/@PACKAGE@" }, \' \
160 >> libpath.tmp
161 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
162 @echo '}' >> libpath.tmp
163 @mv libpath.tmp libpath.h
164
165
166 # ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@
167
168 SUFFIXES = .x .doc
169 .c.x:
170 PATH=.:${PATH} ./guile-doc-snarf $< $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ \
171 || { rm $@; false; }
172 .c.doc:
173 PATH=.:${PATH} ./guile-doc-snarf $< $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< \
174 || { rm $@; false; }
175
176 guile-procedures.txt: $(DOT_DOC_FILES)
177 cat *.doc > $@
178
179 pkgdata_DATA = guile-procedures.txt
180
181 ## Add -MG to make the .x magic work with auto-dep code.
182 MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
183
184 cpp_err_symbols.c: cpp_err_symbols.in
185 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \
186 cpp_err_symbols.tmp
187 mv cpp_err_symbols.tmp cpp_err_symbols.c
188
189 cpp_sig_symbols.c: cpp_sig_symbols.in
190 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_sig_symbols.in > \
191 cpp_sig_symbols.tmp
192 mv cpp_sig_symbols.tmp cpp_sig_symbols.c
193
194 ## Create a new version of the cpp_sig_symbols.in file, including all SIGXXX
195 ## macros defined on this platform.
196 check_signals:
197 gcc -undef -dM -E $(srcdir)/cpp_signal.c | egrep ' SIG[A-Z]+' \
198 | cut -f2 -d' ' | sort > cpp_sig_symbols_here
199 diff -u $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_here \
200 | egrep '^\+S' \
201 | cut -c2- > cpp_sig_symbols_diff
202 if test -s cpp_sig_symbols_diff ; then \
203 cat $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_diff \
204 | sort > cpp_sig_symbols_new ;\
205 echo "cpp_sig_symbols_new has the following additions:" ;\
206 cat cpp_sig_symbols_diff ;\
207 else echo "No new symbols found."; \
208 fi
209
210 ## Likewise for cpp_err_symbols.in.
211 check_errnos:
212 gcc -undef -dM -E $(srcdir)/cpp_errno.c | egrep ' E.+' \
213 | cut -f2 -d' ' | sort > cpp_err_symbols_here
214 diff -u $(srcdir)/cpp_err_symbols.in cpp_err_symbols_here \
215 | egrep '^\+E' \
216 | cut -c2- > cpp_err_symbols_diff
217 if test -s cpp_err_symbols_diff ; then \
218 cat $(srcdir)/cpp_err_symbols.in cpp_err_symbols_diff \
219 | sort > cpp_err_symbols_new ;\
220 echo "cpp_err_symbols_new has the following additions:" ;\
221 cat cpp_err_symbols_diff ;\
222 else echo "No new symbols found."; \
223 fi
224
225 MOSTLYCLEANFILES = \
226 cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
227 cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new
228
229 CLEANFILES = libpath.h
230
231 DISTCLEANFILES = *.x *.doc
232