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