* guile-snarf-docs.in, guile-snarf-docs-texi.in,
[bpt/guile.git] / libguile / Makefile.am
CommitLineData
733943b9 1## Process this file with Automake to create Makefile.in
2764bd99 2##
b0e5fd8c 3## Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
2764bd99
JB
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
733943b9
TT
21
22AUTOMAKE_OPTIONS = foreign
23
a0599745
MD
24## Prevent automake from adding extra -I options
25DEFS = @DEFS@
733943b9
TT
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.
fc7c27fd 29INCLUDES = -I.. -I$(srcdir)/.. ${INCLTDL}
733943b9 30
4079f87e 31ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
abc049a9 32 --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
fef07353 33
e13d8dc0 34lib_LTLIBRARIES = libguile.la
c99f9605 35bin_PROGRAMS = guile guile_filter_doc_snarfage
549436de
JB
36
37guile_SOURCES = guile.c
a0e6f509 38guile_LDADD = libguile.la ${THREAD_LIBS_LOCAL}
6165ede3 39guile_LDFLAGS = @DLPREOPEN@
ee2a8b9b 40
c99f9605
ML
41guile_filter_doc_snarfage_SOURCES = filter-doc-snarfage.c
42
438b2738
MV
43libguile_la_SOURCES = alist.c arbiters.c async.c backtrace.c boolean.c \
44 chars.c continuations.c debug.c deprecation.c dynl.c dynwind.c \
45 environments.c eq.c error.c eval.c evalext.c extensions.c \
46 feature.c fluids.c fports.c \
47 gc.c gc_os_dep.c gdbint.c gh_data.c gh_eval.c gh_funcs.c gh_init.c \
48 gh_io.c gh_list.c gh_predicates.c goops.c gsubr.c guardians.c hash.c \
49 hashtab.c hooks.c init.c ioext.c iselect.c keywords.c lang.c list.c \
50 load.c macros.c mallocs.c modules.c numbers.c objects.c objprop.c \
51 options.c pairs.c ports.c print.c procprop.c procs.c properties.c \
52 random.c rdelim.c read.c root.c rw.c scmsigs.c script.c simpos.c smob.c \
53 sort.c srcprop.c stackchk.c stacks.c stime.c strings.c strop.c \
54 strorder.c strports.c struct.c symbols.c tag.c throw.c values.c \
86d31dfe 55 variable.c vectors.c version.c vports.c weaks.c symbols-deprecated.c
03416a99 56
7e516288
MV
57DOT_X_FILES = alist.x arbiters.x async.x backtrace.x boolean.x chars.x \
58 continuations.x debug.x deprecation.x dynl.x dynwind.x \
59 environments.x eq.x \
438b2738
MV
60 error.x eval.x evalext.x extensions.x feature.x fluids.x fports.x \
61 gc.x goops.x \
7e516288
MV
62 gsubr.x guardians.x hash.x hashtab.x hooks.x init.x ioext.x iselect.x \
63 keywords.x lang.x list.x load.x macros.x mallocs.x modules.x \
64 numbers.x objects.x objprop.x options.x pairs.x ports.x print.x \
65 procprop.x procs.x properties.x random.x rdelim.x read.x root.x rw.x \
66 scmsigs.x script.x simpos.x smob.x sort.x srcprop.x \
67 stackchk.x stacks.x stime.x strings.x strop.x strorder.x strports.x \
68 struct.x symbols.x tag.x throw.x values.x variable.x vectors.x \
86d31dfe 69 version.x vports.x weaks.x symbols-deprecated.x
8bee78b3 70
e9e225e5 71EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
8bee78b3 72
86d31dfe
MV
73DOT_DOC_FILES = alist.doc arbiters.doc async.doc backtrace.doc \
74 boolean.doc chars.doc continuations.doc debug.doc dynl.doc \
75 dynwind.doc environments.doc eq.doc error.doc eval.doc evalext.doc \
438b2738
MV
76 extensions.doc feature.doc fluids.doc fports.doc gc.doc goops.doc \
77 gsubr.doc \
86d31dfe
MV
78 guardians.doc hash.doc hashtab.doc hooks.doc init.doc ioext.doc \
79 iselect.doc keywords.doc lang.doc list.doc load.doc macros.doc \
80 mallocs.doc modules.doc numbers.doc objects.doc objprop.doc \
81 options.doc pairs.doc ports.doc print.doc procprop.doc \
b0e5fd8c 82 procs.doc properties.doc random.doc rdelim.doc read.doc root.doc rw.doc \
86d31dfe
MV
83 scmsigs.doc script.doc simpos.doc smob.doc sort.doc \
84 srcprop.doc stackchk.doc stacks.doc stime.doc strings.doc strop.doc \
85 strorder.doc strports.doc struct.doc symbols.doc tag.doc throw.doc \
86 values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc \
87 symbols-deprecated.doc
a3365d47 88
2ce88b54 89EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
9515eae6 90
5b03c15c 91BUILT_SOURCES = cpp_err_symbols.c cpp_sig_symbols.c libpath.h scmconfig.h \
c99f9605 92 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
9515eae6 93
438b2738 94EXTRA_libguile_la_SOURCES = _scm.h \
60a059e6 95 alloca.c inet_aton.c memmove.c putenv.c strerror.c \
438b2738
MV
96 threads.c regex-posix.c \
97 filesys.c posix.c net_db.c socket.c \
d24e2344 98 ramap.c unif.c debug-malloc.c
7bfd3b9e 99
c99f9605
ML
100Makefile: $(DOT_X_FILES)
101
a8861fa0
MD
102## In next release, threads will be factored out of libguile.
103## Until then, the machine specific headers is a temporary kludge.
104OMIT_DEPENDENCIES = libguile.h ltdl.h \
105 axp.h hppa.h i386.h ksr.h m88k.h mips.h sparc.h vax.h
2ce88b54 106
7bfd3b9e 107## This is kind of nasty... there are ".c" files that we don't want to
1be6b49c
ML
108## compile, since they are #included. So instead we list them here.
109## Perhaps we can deal with them normally once the merge seems to be
110## working.
111noinst_HEADERS = coop-threads.c coop-threads.h coop.c num2integral.i.c
7bfd3b9e 112
78bda5f3 113libguile_la_DEPENDENCIES = @LIBLOBJS@
6165ede3 114libguile_la_LIBADD = @LIBLOBJS@ $(LIBLTDL)
b6fae158 115libguile_la_LDFLAGS = -version-info @LIBGUILE_MAJOR_VERSION@:@LIBGUILE_MINOR_VERSION@:@LIBGUILE_REVISION_VERSION@ -export-dynamic
733943b9 116
ee2a8b9b
JB
117# These are headers visible as <guile/mumble.h>
118pkginclude_HEADERS = gh.h
119
733943b9 120# These are headers visible as <libguile/mumble.h>.
5380de6b 121modincludedir = $(includedir)/libguile
03416a99 122modinclude_HEADERS = __scm.h alist.h arbiters.h async.h backtrace.h boolean.h \
7e516288 123 chars.h continuations.h coop-defs.h debug.h debug-malloc.h deprecation.h \
03416a99 124 dynl.h dynwind.h environments.h eq.h error.h eval.h evalext.h \
438b2738
MV
125 extensions.h feature.h filesys.h fluids.h fports.h gc.h \
126 gdb_interface.h gdbint.h \
03416a99
KN
127 goops.h gsubr.h guardians.h hash.h hashtab.h hooks.h init.h ioext.h \
128 iselect.h keywords.h lang.h list.h load.h macros.h mallocs.h modules.h \
129 net_db.h numbers.h objects.h objprop.h options.h pairs.h ports.h posix.h \
130 regex-posix.h print.h procprop.h procs.h properties.h random.h ramap.h \
b0e5fd8c 131 rdelim.h read.h root.h rw.h scmsigs.h validate.h script.h simpos.h smob.h \
03416a99
KN
132 snarf.h socket.h sort.h srcprop.h stackchk.h stacks.h stime.h strings.h \
133 strop.h strorder.h strports.h struct.h symbols.h tag.h tags.h threads.h \
134 throw.h unif.h values.h variable.h vectors.h version.h vports.h weaks.h
4725c298 135
adb75a41
TT
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.
733943b9
TT
138modinclude_DATA = scmconfig.h
139
c99f9605
ML
140bin_SCRIPTS = guile-snarf guile-doc-snarf guile-snarf-docs \
141 guile-snarf-docs-texi guile-func-name-check
adb75a41 142
6165ede3 143EXTRA_DIST = ChangeLog-gh ChangeLog-scm ChangeLog-threads cpp_signal.c \
b2728432 144 cpp_errno.c cpp_err_symbols.in cpp_sig_symbols.in cpp_cnvt.awk
c99f9605
ML
145# $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
146# guile-procedures.txt guile.texi
733943b9 147
fef07353 148## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
90ff3ec5 149libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
e151bee6
JB
150 @echo "Generating libpath.h..."
151 @rm -f libpath.tmp
152 @echo '/* generated by Makefile */' > libpath.tmp
153 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
154 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(VERSION)"'>>libpath.tmp
155 @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
156 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
157 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
158 @echo ' { "top_srcdir", "'"`cd @top_srcdir@; pwd`"'" }, \' \
159 >> libpath.tmp
160 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
161 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
162 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
163 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
164 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
165 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
166 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
167 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
168 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
169 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
170 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
171 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
172 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
173 @echo ' { "pkgdatadir", "$(datadir)/@PACKAGE@" }, \' >> libpath.tmp
174 @echo ' { "pkglibdir", "$(libdir)/@PACKAGE@" }, \' >> libpath.tmp
175 @echo ' { "pkgincludedir", "$(includedir)/@PACKAGE@" }, \' \
176 >> libpath.tmp
b6fae158
CB
177 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
178 @echo ' { "libguileversion", "@LIBGUILE_VERSION@" }, \' >> libpath.tmp
30dda257 179 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
e151bee6
JB
180 @echo '}' >> libpath.tmp
181 @mv libpath.tmp libpath.h
733943b9 182
3dc81fba
GB
183
184# ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@
185
186SUFFIXES = .x .doc
733943b9 187.c.x:
c99f9605 188 ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ \
95042d95 189 || { rm $@; false; }
c99f9605
ML
190.c.doc:
191 -(test -n "${AWK+set}" || AWK="@AWK@"; ${AWK} -f ./guile-func-name-check $<)
192 ./guile-snarf-docs $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ \
3dc81fba 193 || { rm $@; false; }
733943b9 194
c99f9605
ML
195$(DOT_X_FILES) $(EXTRA_DOT_DOC_FILES): snarf.h guile-snarf.in
196
197$(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): snarf.h guile-snarf-docs.in guile_filter_doc_snarfage
66418d34 198
faf6a29b
MV
199error.x: cpp_err_symbols.c
200posix.x: cpp_sig_symbols.c
201load.x: libpath.h
202
c99f9605
ML
203guile.texi: $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) guile-snarf-docs-texi.in guile
204 ./guile-snarf-docs-texi $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) > $@ \
205 || { rm $@; false; }
9d29e990
NJ
206
207guile-procedures.txt: guile.texi
208 rm -f $@
209 makeinfo --force -o $@ $< || test -f $@
4079f87e 210
8dc9439f
MV
211schemelibdir = $(pkgdatadir)/$(VERSION)
212schemelib_DATA = guile-procedures.txt
4079f87e 213
733943b9
TT
214## Add -MG to make the .x magic work with auto-dep code.
215MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
ee78fbb0 216
a9c093e2 217cpp_err_symbols.c: cpp_err_symbols.in cpp_cnvt.awk
a0e90145 218 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \
593d151f
JB
219 cpp_err_symbols.tmp
220 mv cpp_err_symbols.tmp cpp_err_symbols.c
ee78fbb0 221
a9c093e2 222cpp_sig_symbols.c: cpp_sig_symbols.in cpp_cnvt.awk
a0e90145 223 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_sig_symbols.in > \
593d151f
JB
224 cpp_sig_symbols.tmp
225 mv cpp_sig_symbols.tmp cpp_sig_symbols.c
67ec3667 226
a0e90145 227## Create a new version of the cpp_sig_symbols.in file, including all SIGXXX
67ec3667
GH
228## macros defined on this platform.
229check_signals:
230 gcc -undef -dM -E $(srcdir)/cpp_signal.c | egrep ' SIG[A-Z]+' \
231 | cut -f2 -d' ' | sort > cpp_sig_symbols_here
a0e90145
JB
232 diff -u $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_here \
233 | egrep '^\+S' \
67ec3667
GH
234 | cut -c2- > cpp_sig_symbols_diff
235 if test -s cpp_sig_symbols_diff ; then \
a0e90145 236 cat $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_diff \
67ec3667
GH
237 | sort > cpp_sig_symbols_new ;\
238 echo "cpp_sig_symbols_new has the following additions:" ;\
239 cat cpp_sig_symbols_diff ;\
240 else echo "No new symbols found."; \
241 fi
242
a0e90145 243## Likewise for cpp_err_symbols.in.
67ec3667
GH
244check_errnos:
245 gcc -undef -dM -E $(srcdir)/cpp_errno.c | egrep ' E.+' \
246 | cut -f2 -d' ' | sort > cpp_err_symbols_here
a0e90145
JB
247 diff -u $(srcdir)/cpp_err_symbols.in cpp_err_symbols_here \
248 | egrep '^\+E' \
67ec3667
GH
249 | cut -c2- > cpp_err_symbols_diff
250 if test -s cpp_err_symbols_diff ; then \
a0e90145 251 cat $(srcdir)/cpp_err_symbols.in cpp_err_symbols_diff \
67ec3667
GH
252 | sort > cpp_err_symbols_new ;\
253 echo "cpp_err_symbols_new has the following additions:" ;\
254 cat cpp_err_symbols_diff ;\
255 else echo "No new symbols found."; \
256 fi
257
ad6b30a0
TP
258MOSTLYCLEANFILES = \
259 cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
67ec3667 260 cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new
ad6b30a0 261
c99f9605 262CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile.texi