* alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,
[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)/.. ${INCLTDL}
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 environments.c eq.c error.c \
44 eval.c evalext.c feature.c fluids.c fports.c gc.c gdbint.c gh_data.c \
45 gh_eval.c gh_funcs.c gh_init.c gh_io.c gh_list.c gh_predicates.c \
46 goops.c gsubr.c guardians.c hash.c hashtab.c hooks.c init.c ioext.c \
47 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 ports.c \
49 print.c procprop.c procs.c random.c read.c root.c scmsigs.c \
50 script.c simpos.c smob.c sort.c srcprop.c stackchk.c stacks.c \
51 stime.c strings.c strop.c strorder.c strports.c struct.c symbols.c \
52 tag.c throw.c variable.c vectors.c version.c vports.c weaks.c \
53 gc_os_dep.c properties.c
54
55 DOT_X_FILES = \
56 alist.x arbiters.x \
57 async.x backtrace.x boolean.x chars.x continuations.x debug.x \
58 dynl.x dynwind.x environments.x eq.x error.x eval.x evalext.x \
59 feature.x \
60 fluids.x fports.x gc.x goops.x gsubr.x guardians.x hash.x hashtab.x \
61 hooks.x init.x ioext.x iselect.x keywords.x lang.x list.x load.x \
62 macros.x mallocs.x modules.x net_db.x numbers.x objects.x \
63 objprop.x options.x pairs.x ports.x posix.x print.x procprop.x \
64 procs.x random.x read.x root.x scmsigs.x \
65 script.x simpos.x smob.x socket.x sort.x srcprop.x stackchk.x \
66 stacks.x stime.x strings.x strop.x strorder.x strports.x struct.x \
67 symbols.x tag.x throw.x variable.x vectors.x \
68 version.x vports.x weaks.x properties.x
69
70 EXTRA_DOT_X_FILES = debug-malloc.x filesys.x net_db.x posix.x ramap.x \
71 regex-posix.x socket.x threads.x unif.x
72
73 DOT_DOC_FILES = \
74 alist.doc arbiters.doc async.doc backtrace.doc boolean.doc \
75 chars.doc continuations.doc debug.doc dynl.doc dynwind.doc \
76 environments.doc eq.doc \
77 error.doc eval.doc evalext.doc feature.doc fluids.doc fports.doc \
78 gc.doc goops.doc gsubr.doc guardians.doc hash.doc hashtab.doc \
79 hooks.doc init.doc \
80 ioext.doc iselect.doc keywords.doc lang.doc list.doc load.doc \
81 macros.doc mallocs.doc modules.doc net_db.doc numbers.doc objects.doc \
82 objprop.doc options.doc pairs.doc ports.doc posix.doc print.doc \
83 procprop.doc procs.doc random.doc read.doc root.doc scmsigs.doc \
84 script.doc simpos.doc smob.doc socket.doc sort.doc srcprop.doc \
85 stackchk.doc stacks.doc stime.doc strings.doc strop.doc strorder.doc \
86 strports.doc struct.doc symbols.doc tag.doc throw.doc variable.doc \
87 vectors.doc version.doc vports.doc weaks.doc properties.doc
88
89 EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
90
91 BUILT_SOURCES = cpp_err_symbols.c cpp_sig_symbols.c libpath.h scmconfig.h \
92 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES) $(DOT_DOC_FILES)
93
94 EXTRA_libguile_la_SOURCES = _scm.h \
95 alloca.c inet_aton.c memmove.c putenv.c strerror.c \
96 threads.c regex-posix.c \
97 filesys.c posix.c net_db.c socket.c \
98 ramap.c unif.c debug-malloc.c
99
100 ## In next release, threads will be factored out of libguile.
101 ## Until then, the machine specific headers is a temporary kludge.
102 OMIT_DEPENDENCIES = libguile.h ltdl.h \
103 axp.h hppa.h i386.h ksr.h m88k.h mips.h sparc.h vax.h
104
105 ## This is kind of nasty... there are ".c" files that we don't want to
106 ## compile, since they are #included in threads.c. So instead we list
107 ## them here. Perhaps we can deal with them normally once the merge
108 ## seems to be working.
109 noinst_HEADERS = coop-threads.c coop-threads.h coop.c
110
111 libguile_la_DEPENDENCIES = @LIBLOBJS@
112 libguile_la_LIBADD = @LIBLOBJS@ $(LIBLTDL)
113 libguile_la_LDFLAGS = -version-info @LIBGUILE_MAJOR_VERSION@:@LIBGUILE_MINOR_VERSION@:@LIBGUILE_REVISION_VERSION@ -export-dynamic
114
115 # These are headers visible as <guile/mumble.h>
116 pkginclude_HEADERS = gh.h
117
118 # These are headers visible as <libguile/mumble.h>.
119 modincludedir = $(includedir)/libguile
120 modinclude_HEADERS = \
121 __scm.h alist.h arbiters.h async.h backtrace.h boolean.h chars.h \
122 continuations.h debug.h dynl.h dynwind.h environments.h eq.h \
123 error.h eval.h \
124 evalext.h feature.h filesys.h fports.h gc.h gdb_interface.h \
125 gdbint.h goops.h gsubr.h guardians.h hash.h hashtab.h hooks.h init.h \
126 ioext.h keywords.h lang.h list.h load.h macros.h mallocs.h \
127 modules.h net_db.h numbers.h objects.h objprop.h options.h pairs.h \
128 ports.h posix.h regex-posix.h print.h procprop.h procs.h random.h \
129 ramap.h read.h root.h scmsigs.h validate.h script.h simpos.h \
130 smob.h socket.h sort.h srcprop.h stackchk.h stacks.h stime.h \
131 strings.h strop.h strorder.h strports.h struct.h symbols.h tag.h \
132 tags.h throw.h unif.h variable.h vectors.h version.h vports.h \
133 weaks.h snarf.h threads.h coop-defs.h fluids.h iselect.h \
134 debug-malloc.h properties.h
135
136 ## This file is generated at configure time. That is why it is DATA
137 ## and not a header -- headers are included in the distribution.
138 modinclude_DATA = scmconfig.h
139
140 bin_SCRIPTS = guile-snarf guile-doc-snarf guile-snarf.awk guile-func-name-check
141
142 EXTRA_DIST = ChangeLog-gh ChangeLog-scm ChangeLog-threads cpp_signal.c \
143 cpp_errno.c cpp_err_symbols.in cpp_sig_symbols.in cpp_cnvt.awk
144
145 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
146 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
147 @echo "Generating libpath.h..."
148 @rm -f libpath.tmp
149 @echo '/* generated by Makefile */' > libpath.tmp
150 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
151 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(VERSION)"'>>libpath.tmp
152 @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
153 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
154 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
155 @echo ' { "top_srcdir", "'"`cd @top_srcdir@; pwd`"'" }, \' \
156 >> libpath.tmp
157 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
158 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
159 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
160 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
161 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
162 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
163 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
164 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
165 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
166 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
167 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
168 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
169 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
170 @echo ' { "pkgdatadir", "$(datadir)/@PACKAGE@" }, \' >> libpath.tmp
171 @echo ' { "pkglibdir", "$(libdir)/@PACKAGE@" }, \' >> libpath.tmp
172 @echo ' { "pkgincludedir", "$(includedir)/@PACKAGE@" }, \' \
173 >> libpath.tmp
174 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
175 @echo ' { "libguileversion", "@LIBGUILE_VERSION@" }, \' >> libpath.tmp
176 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
177 @echo '}' >> libpath.tmp
178 @mv libpath.tmp libpath.h
179
180
181 # ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@
182
183 SUFFIXES = .x .doc
184 .c.x:
185 PATH=.:${PATH} ./guile-doc-snarf $< $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ \
186 || { rm $@; false; }
187 .x.doc:
188 PATH=.:${PATH} ./guile-doc-snarf $(srcdir)/$*.c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(srcdir)/$*.c > /dev/null \
189 || { rm $@; false; }
190
191 error.x: cpp_err_symbols.c
192 posix.x: cpp_sig_symbols.c
193 load.x: libpath.h
194
195 guile.texi: $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
196 echo "@paragraphindent 0" > $@
197 cat *.doc >> $@
198
199 guile-procedures.txt: guile.texi
200 rm -f $@
201 makeinfo --force -o $@ $< || test -f $@
202
203 schemelibdir = $(pkgdatadir)/$(VERSION)
204 schemelib_DATA = guile-procedures.txt
205
206 ## Add -MG to make the .x magic work with auto-dep code.
207 MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
208
209 cpp_err_symbols.c: cpp_err_symbols.in
210 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \
211 cpp_err_symbols.tmp
212 mv cpp_err_symbols.tmp cpp_err_symbols.c
213
214 cpp_sig_symbols.c: cpp_sig_symbols.in
215 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_sig_symbols.in > \
216 cpp_sig_symbols.tmp
217 mv cpp_sig_symbols.tmp cpp_sig_symbols.c
218
219 ## Create a new version of the cpp_sig_symbols.in file, including all SIGXXX
220 ## macros defined on this platform.
221 check_signals:
222 gcc -undef -dM -E $(srcdir)/cpp_signal.c | egrep ' SIG[A-Z]+' \
223 | cut -f2 -d' ' | sort > cpp_sig_symbols_here
224 diff -u $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_here \
225 | egrep '^\+S' \
226 | cut -c2- > cpp_sig_symbols_diff
227 if test -s cpp_sig_symbols_diff ; then \
228 cat $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_diff \
229 | sort > cpp_sig_symbols_new ;\
230 echo "cpp_sig_symbols_new has the following additions:" ;\
231 cat cpp_sig_symbols_diff ;\
232 else echo "No new symbols found."; \
233 fi
234
235 ## Likewise for cpp_err_symbols.in.
236 check_errnos:
237 gcc -undef -dM -E $(srcdir)/cpp_errno.c | egrep ' E.+' \
238 | cut -f2 -d' ' | sort > cpp_err_symbols_here
239 diff -u $(srcdir)/cpp_err_symbols.in cpp_err_symbols_here \
240 | egrep '^\+E' \
241 | cut -c2- > cpp_err_symbols_diff
242 if test -s cpp_err_symbols_diff ; then \
243 cat $(srcdir)/cpp_err_symbols.in cpp_err_symbols_diff \
244 | sort > cpp_err_symbols_new ;\
245 echo "cpp_err_symbols_new has the following additions:" ;\
246 cat cpp_err_symbols_diff ;\
247 else echo "No new symbols found."; \
248 fi
249
250 MOSTLYCLEANFILES = \
251 cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
252 cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new
253
254 CLEANFILES = libpath.h *.x *.doc