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