Update copyright.
[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.
54f16aec 6##
2764bd99
JB
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.
54f16aec 11##
2764bd99
JB
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.
54f16aec 16##
2764bd99
JB
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 21
3307df95 22AUTOMAKE_OPTIONS = gnu
733943b9 23
a0599745 24## Prevent automake from adding extra -I options
8f99e3f3 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
f94b6524
TTN
35bin_PROGRAMS = guile
36noinst_PROGRAMS = guile_filter_doc_snarfage
549436de
JB
37
38guile_SOURCES = guile.c
8f99e3f3 39guile_LDADD = libguile.la
6165ede3 40guile_LDFLAGS = @DLPREOPEN@
ee2a8b9b 41
ac13d9d2 42guile_filter_doc_snarfage_SOURCES = c-tokenize.c
c99f9605 43
438b2738 44libguile_la_SOURCES = alist.c arbiters.c async.c backtrace.c boolean.c \
1fa86ca5
SJ
45 chars.c continuations.c convert.c debug.c deprecation.c dynl.c \
46 dynwind.c environments.c eq.c error.c eval.c evalext.c extensions.c \
438b2738
MV
47 feature.c fluids.c fports.c \
48 gc.c gc_os_dep.c gdbint.c gh_data.c gh_eval.c gh_funcs.c gh_init.c \
49 gh_io.c gh_list.c gh_predicates.c goops.c gsubr.c guardians.c hash.c \
9b7ee9d8
MV
50 hashtab.c hooks.c init.c inline.c ioext.c iselect.c keywords.c \
51 lang.c list.c \
438b2738
MV
52 load.c macros.c mallocs.c modules.c numbers.c objects.c objprop.c \
53 options.c pairs.c ports.c print.c procprop.c procs.c properties.c \
54 random.c rdelim.c read.c root.c rw.c scmsigs.c script.c simpos.c smob.c \
55 sort.c srcprop.c stackchk.c stacks.c stime.c strings.c strop.c \
9b7ee9d8 56 strorder.c strports.c struct.c symbols.c throw.c values.c \
dee01b01 57 variable.c vectors.c version.c vports.c weaks.c
03416a99 58
7e516288
MV
59DOT_X_FILES = alist.x arbiters.x async.x backtrace.x boolean.x chars.x \
60 continuations.x debug.x deprecation.x dynl.x dynwind.x \
61 environments.x eq.x \
438b2738
MV
62 error.x eval.x evalext.x extensions.x feature.x fluids.x fports.x \
63 gc.x goops.x \
7e516288
MV
64 gsubr.x guardians.x hash.x hashtab.x hooks.x init.x ioext.x iselect.x \
65 keywords.x lang.x list.x load.x macros.x mallocs.x modules.x \
66 numbers.x objects.x objprop.x options.x pairs.x ports.x print.x \
67 procprop.x procs.x properties.x random.x rdelim.x read.x root.x rw.x \
68 scmsigs.x script.x simpos.x smob.x sort.x srcprop.x \
69 stackchk.x stacks.x stime.x strings.x strop.x strorder.x strports.x \
6b41a313 70 struct.x symbols.x throw.x values.x variable.x vectors.x \
dee01b01 71 version.x vports.x weaks.x
8bee78b3 72
e9e225e5 73EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
8bee78b3 74
86d31dfe
MV
75DOT_DOC_FILES = alist.doc arbiters.doc async.doc backtrace.doc \
76 boolean.doc chars.doc continuations.doc debug.doc dynl.doc \
77 dynwind.doc environments.doc eq.doc error.doc eval.doc evalext.doc \
438b2738
MV
78 extensions.doc feature.doc fluids.doc fports.doc gc.doc goops.doc \
79 gsubr.doc \
86d31dfe
MV
80 guardians.doc hash.doc hashtab.doc hooks.doc init.doc ioext.doc \
81 iselect.doc keywords.doc lang.doc list.doc load.doc macros.doc \
82 mallocs.doc modules.doc numbers.doc objects.doc objprop.doc \
83 options.doc pairs.doc ports.doc print.doc procprop.doc \
b0e5fd8c 84 procs.doc properties.doc random.doc rdelim.doc read.doc root.doc rw.doc \
86d31dfe
MV
85 scmsigs.doc script.doc simpos.doc smob.doc sort.doc \
86 srcprop.doc stackchk.doc stacks.doc stime.doc strings.doc strop.doc \
6b41a313 87 strorder.doc strports.doc struct.doc symbols.doc throw.doc \
dee01b01 88 values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc
a3365d47 89
2ce88b54 90EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
9515eae6 91
5b03c15c 92BUILT_SOURCES = cpp_err_symbols.c cpp_sig_symbols.c libpath.h scmconfig.h \
cecb4a5e 93 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES) guile.texi
9515eae6 94
438b2738 95EXTRA_libguile_la_SOURCES = _scm.h \
60a059e6 96 alloca.c inet_aton.c memmove.c putenv.c strerror.c \
438b2738
MV
97 threads.c regex-posix.c \
98 filesys.c posix.c net_db.c socket.c \
b4e15479
SJ
99 ramap.c unif.c debug-malloc.c mkstemp.c \
100 win32-uname.c win32-dirent.c win32-socket.c
7bfd3b9e 101
413a1367
ML
102## delete guile-snarf.awk from the installation bindir, in case it's
103## lingering there due to an earlier guile version not having been
104## wiped out.
105install-exec-hook:
b27b814d 106 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
413a1367 107
7bfd3b9e 108## This is kind of nasty... there are ".c" files that we don't want to
1be6b49c
ML
109## compile, since they are #included. So instead we list them here.
110## Perhaps we can deal with them normally once the merge seems to be
111## working.
5437598b 112noinst_HEADERS = coop-threads.c coop-threads.h coop.c \
1fa86ca5 113 num2integral.i.c num2float.i.c convert.i.c \
b4e15479 114 win32-uname.h win32-dirent.h win32-socket.h
7bfd3b9e 115
78bda5f3 116libguile_la_DEPENDENCIES = @LIBLOBJS@
8f99e3f3 117libguile_la_LIBADD = @LIBLOBJS@ $(LIBLTDL) $(THREAD_LIBS_LOCAL)
94b1762d 118libguile_la_LDFLAGS = -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ -export-dynamic -no-undefined
733943b9 119
54f16aec 120# These are headers visible as <guile/mumble.h>
ee2a8b9b
JB
121pkginclude_HEADERS = gh.h
122
733943b9 123# These are headers visible as <libguile/mumble.h>.
5380de6b 124modincludedir = $(includedir)/libguile
03416a99 125modinclude_HEADERS = __scm.h alist.h arbiters.h async.h backtrace.h boolean.h \
1fa86ca5
SJ
126 chars.h continuations.h convert.h coop-defs.h debug.h debug-malloc.h \
127 deprecation.h dynl.h dynwind.h environments.h eq.h error.h eval.h \
128 evalext.h extensions.h feature.h filesys.h fluids.h fports.h gc.h \
438b2738 129 gdb_interface.h gdbint.h \
9b7ee9d8
MV
130 goops.h gsubr.h guardians.h hash.h hashtab.h hooks.h init.h \
131 inline.h ioext.h \
03416a99
KN
132 iselect.h keywords.h lang.h list.h load.h macros.h mallocs.h modules.h \
133 net_db.h numbers.h objects.h objprop.h options.h pairs.h ports.h posix.h \
134 regex-posix.h print.h procprop.h procs.h properties.h random.h ramap.h \
b0e5fd8c 135 rdelim.h read.h root.h rw.h scmsigs.h validate.h script.h simpos.h smob.h \
03416a99 136 snarf.h socket.h sort.h srcprop.h stackchk.h stacks.h stime.h strings.h \
6b41a313 137 strop.h strorder.h strports.h struct.h symbols.h tags.h threads.h \
03416a99 138 throw.h unif.h values.h variable.h vectors.h version.h vports.h weaks.h
4725c298 139
adb75a41
TT
140## This file is generated at configure time. That is why it is DATA
141## and not a header -- headers are included in the distribution.
733943b9
TT
142modinclude_DATA = scmconfig.h
143
604a672e
TTN
144bin_SCRIPTS = guile-snarf
145
f94b6524
TTN
146# We can re-enable install for some of these if/when they are documented
147# and people feel like maintaining them. For now, this is not the case.
604a672e 148noinst_SCRIPTS = guile-doc-snarf guile-snarf-docs guile-func-name-check
adb75a41 149
41973b48
MV
150EXTRA_DIST = ChangeLog-gh ChangeLog-scm ChangeLog-threads \
151 ChangeLog-1996-1999 ChangeLog-2000 cpp_signal.c \
152 cpp_errno.c cpp_err_symbols.in cpp_sig_symbols.in cpp_cnvt.awk \
30e3be5a 153 c-tokenize.lex
c99f9605
ML
154# $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
155# guile-procedures.txt guile.texi
733943b9 156
fef07353 157## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
90ff3ec5 158libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
54f16aec 159 @echo "Generating libpath.h..."
e151bee6
JB
160 @rm -f libpath.tmp
161 @echo '/* generated by Makefile */' > libpath.tmp
162 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
163 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(VERSION)"'>>libpath.tmp
164 @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
165 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
166 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
167 @echo ' { "top_srcdir", "'"`cd @top_srcdir@; pwd`"'" }, \' \
168 >> libpath.tmp
169 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
170 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
171 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
172 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
173 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
174 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
175 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
176 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
177 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
178 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
179 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
180 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
181 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
182 @echo ' { "pkgdatadir", "$(datadir)/@PACKAGE@" }, \' >> libpath.tmp
183 @echo ' { "pkglibdir", "$(libdir)/@PACKAGE@" }, \' >> libpath.tmp
184 @echo ' { "pkgincludedir", "$(includedir)/@PACKAGE@" }, \' \
185 >> libpath.tmp
b6fae158 186 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
54f16aec
TTN
187 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
188 >> libpath.tmp
30dda257 189 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
54f16aec 190 @echo ' { "buildstamp", "'"`date`"'" }, \' >> libpath.tmp
e151bee6
JB
191 @echo '}' >> libpath.tmp
192 @mv libpath.tmp libpath.h
733943b9 193
3dc81fba 194
3dc81fba 195SUFFIXES = .x .doc
733943b9 196.c.x:
c99f9605 197 ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ \
95042d95 198 || { rm $@; false; }
c99f9605
ML
199.c.doc:
200 -(test -n "${AWK+set}" || AWK="@AWK@"; ${AWK} -f ./guile-func-name-check $<)
8b1d12c7 201 (./guile-snarf-docs $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< | \
af68e5e5 202 ./guile_filter_doc_snarfage$(EXEEXT) --filter-snarfage) > $@ || { rm $@; false; }
733943b9 203
c99f9605
ML
204$(DOT_X_FILES) $(EXTRA_DOT_DOC_FILES): snarf.h guile-snarf.in
205
94b1762d 206$(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
66418d34 207
faf6a29b
MV
208error.x: cpp_err_symbols.c
209posix.x: cpp_sig_symbols.c
210load.x: libpath.h
211
58ed8bc6 212include $(top_srcdir)/am/pre-inst-guile
cecb4a5e 213
f8241358
TTN
214alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
215snarf2checkedtexi = $(preinstguiletool)/snarf-check-and-output-texi
216dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
217
218guile.texi: $(alldotdocfiles) guile
219 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
220
221guile-procedures.texi: $(alldotdocfiles) guile
222 $(dotdoc2texi) > $@ || { rm $@; false; }
9d29e990 223
9df3eecc
MV
224if HAVE_MAKEINFO
225
cecb4a5e 226guile-procedures.txt: guile-procedures.texi
9d29e990
NJ
227 rm -f $@
228 makeinfo --force -o $@ $< || test -f $@
4079f87e 229
9df3eecc
MV
230else
231
232guile-procedures.txt: guile-procedures.texi
233 cp $< $@
234
235endif
236
30e3be5a
ML
237c-tokenize.c: c-tokenize.lex
238 flex -t $< > $@ || { rm $@; false; }
239
8dc9439f
MV
240schemelibdir = $(pkgdatadir)/$(VERSION)
241schemelib_DATA = guile-procedures.txt
4079f87e 242
733943b9
TT
243## Add -MG to make the .x magic work with auto-dep code.
244MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
ee78fbb0 245
a9c093e2 246cpp_err_symbols.c: cpp_err_symbols.in cpp_cnvt.awk
a0e90145 247 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \
593d151f
JB
248 cpp_err_symbols.tmp
249 mv cpp_err_symbols.tmp cpp_err_symbols.c
ee78fbb0 250
a9c093e2 251cpp_sig_symbols.c: cpp_sig_symbols.in cpp_cnvt.awk
a0e90145 252 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_sig_symbols.in > \
593d151f
JB
253 cpp_sig_symbols.tmp
254 mv cpp_sig_symbols.tmp cpp_sig_symbols.c
67ec3667 255
a0e90145 256## Create a new version of the cpp_sig_symbols.in file, including all SIGXXX
67ec3667
GH
257## macros defined on this platform.
258check_signals:
259 gcc -undef -dM -E $(srcdir)/cpp_signal.c | egrep ' SIG[A-Z]+' \
260 | cut -f2 -d' ' | sort > cpp_sig_symbols_here
a0e90145
JB
261 diff -u $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_here \
262 | egrep '^\+S' \
67ec3667
GH
263 | cut -c2- > cpp_sig_symbols_diff
264 if test -s cpp_sig_symbols_diff ; then \
a0e90145 265 cat $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_diff \
67ec3667
GH
266 | sort > cpp_sig_symbols_new ;\
267 echo "cpp_sig_symbols_new has the following additions:" ;\
268 cat cpp_sig_symbols_diff ;\
269 else echo "No new symbols found."; \
270 fi
271
a0e90145 272## Likewise for cpp_err_symbols.in.
67ec3667
GH
273check_errnos:
274 gcc -undef -dM -E $(srcdir)/cpp_errno.c | egrep ' E.+' \
275 | cut -f2 -d' ' | sort > cpp_err_symbols_here
a0e90145
JB
276 diff -u $(srcdir)/cpp_err_symbols.in cpp_err_symbols_here \
277 | egrep '^\+E' \
67ec3667
GH
278 | cut -c2- > cpp_err_symbols_diff
279 if test -s cpp_err_symbols_diff ; then \
a0e90145 280 cat $(srcdir)/cpp_err_symbols.in cpp_err_symbols_diff \
67ec3667
GH
281 | sort > cpp_err_symbols_new ;\
282 echo "cpp_err_symbols_new has the following additions:" ;\
283 cat cpp_err_symbols_diff ;\
284 else echo "No new symbols found."; \
285 fi
286
ad6b30a0
TP
287MOSTLYCLEANFILES = \
288 cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
67ec3667 289 cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new
ad6b30a0 290
cecb4a5e 291CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi
ee0c0e03
ML
292
293MAINTAINERCLEANFILES = c-tokenize.c