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