top level fixes
[bpt/guile.git] / libguile / Makefile.am
CommitLineData
733943b9 1## Process this file with Automake to create Makefile.in
2764bd99 2##
e4598559 3## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007,
12432c86 4## 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
2764bd99
JB
5##
6## This file is part of GUILE.
54f16aec 7##
53befeb7
NJ
8## GUILE is free software; you can redistribute it and/or modify it
9## under the terms of the GNU Lesser General Public License as
10## published by the Free Software Foundation; either version 3, or
2764bd99 11## (at your option) any later version.
54f16aec 12##
2764bd99
JB
13## GUILE is distributed in the hope that it will be useful, but
14## WITHOUT ANY WARRANTY; without even the implied warranty of
15## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53befeb7 16## GNU Lesser General Public License for more details.
54f16aec 17##
53befeb7
NJ
18## You should have received a copy of the GNU Lesser General Public
19## License along with GUILE; see the file COPYING.LESSER. If not,
20## write to the Free Software Foundation, Inc., 51 Franklin Street,
21## Fifth Floor, Boston, MA 02110-1301 USA
733943b9 22
a572fc95
NI
23include $(top_srcdir)/am/snarf
24
3307df95 25AUTOMAKE_OPTIONS = gnu
733943b9 26
a0599745 27## Prevent automake from adding extra -I options
8f99e3f3 28DEFS = @DEFS@
535b3592
LC
29
30# Override Automake's `DEFAULT_INCLUDES'. By default, it contains
31# "-I$(srcdir)", which causes problems on Tru64 where our "random.h"
32# is picked up by <stdlib.h> instead of the libc's <random.h>.
33DEFAULT_INCLUDES =
34
733943b9
TT
35## Check for headers in $(srcdir)/.., so that #include
36## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
6caac03c 37## building. Also look for Gnulib headers in `lib'.
442f3f20 38AM_CPPFLAGS = -DBUILDING_LIBGUILE=1 -I$(top_srcdir) -I$(top_builddir) \
d8b04f04 39 -I$(top_srcdir)/lib -I$(top_builddir)/lib $(LIBFFI_CFLAGS)
6caac03c 40
d8b04f04 41AM_CFLAGS = $(GCC_CFLAGS) $(CFLAG_VISIBILITY)
6caac03c
LC
42
43## The Gnulib Libtool archive.
44gnulib_library = $(top_builddir)/lib/libgnu.la
733943b9 45
4079f87e 46ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
abc049a9 47 --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
fef07353 48
44602b08 49lib_LTLIBRARIES = libguile-@GUILE_EFFECTIVE_VERSION@.la
f94b6524 50bin_PROGRAMS = guile
b32fca0f 51
64c2db80
RB
52noinst_PROGRAMS = guile_filter_doc_snarfage gen-scmconfig
53
54gen_scmconfig_SOURCES = gen-scmconfig.c
55
a04e5749
AW
56## Override default rule; this should be compiled for BUILD host. Note
57## that we don't add $(AM_CPPFLAGS) here, as we need to run this
58## program, but $(top_srcdir)/lib has a gnulib configured for the
59## target. Instead we manually add $(top_builddir), in order to pick up
60## the generated config.h and gen-scmconfig.h. Nothing else from Guile
61## is included by this code generator.
64c2db80 62gen-scmconfig.$(OBJEXT): gen-scmconfig.c
ad378da9
AW
63 $(AM_V_GEN) \
64 if [ "$(cross_compiling)" = "yes" ]; then \
a04e5749 65 $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) -I$(top_builddir) \
b3da54d1 66 -c -o $@ $<; \
ad378da9
AW
67 else \
68 $(COMPILE) -c -o $@ $<; \
64c2db80
RB
69 fi
70
2e945bcc 71## Override default rule; this should run on BUILD host.
6a6df187 72gen-scmconfig$(EXEEXT): $(gen_scmconfig_OBJECTS) $(gen_scmconfig_DEPENDENCIES)
a572fc95
NI
73 $(AM_V_GEN) \
74 rm -f gen-scmconfig$(EXEEXT); \
2e945bcc
SJ
75 if [ "$(cross_compiling)" = "yes" ]; then \
76 $(CCLD_FOR_BUILD) -o $@ $(gen_scmconfig_OBJECTS); \
77 else \
78 $(LINK) $(gen_scmconfig_OBJECTS) $(LDADD) $(LIBS); \
79 fi
80
81scmconfig.h: ${top_builddir}/config.h gen-scmconfig$(EXEEXT)
a572fc95
NI
82 $(AM_V_GEN)(rm -f scmconfig.h.tmp; \
83 cat $(srcdir)/scmconfig.h.top > scmconfig.h.tmp; \
84 ./gen-scmconfig$(EXEEXT) >> scmconfig.h.tmp; \
85 chmod 444 scmconfig.h.tmp; \
86 rm -f scmconfig.h; \
87 mv scmconfig.h.tmp scmconfig.h)
88
64c2db80 89
b32fca0f
MV
90guile_filter_doc_snarfage_SOURCES = c-tokenize.c
91
92## Override default rule; this should be compiled for BUILD host.
93## For some reason, OBJEXT does not include the dot
94c-tokenize.$(OBJEXT): c-tokenize.c
8cb0d6d7
LC
95 $(AM_V_GEN) \
96 if [ "$(cross_compiling)" = "yes" ]; then \
97 $(CC_FOR_BUILD) -DCROSS_COMPILING=1 -I$(top_builddir) \
98 -c -o "$@" "$<"; \
99 else \
100 $(COMPILE) -c -o "$@" "$<"; \
b32fca0f
MV
101 fi
102
103## Override default rule; this should run on BUILD host.
6a6df187 104guile_filter_doc_snarfage$(EXEEXT): $(guile_filter_doc_snarfage_OBJECTS) $(guile_filter_doc_snarfage_DEPENDENCIES)
a572fc95
NI
105 $(AM_V_GEN) \
106 rm -f guile_filter_doc_snarfage$(EXEEXT); \
b32fca0f
MV
107 if [ "$(cross_compiling)" = "yes" ]; then \
108 $(CCLD_FOR_BUILD) -o $@ $(guile_filter_doc_snarfage_OBJECTS); \
109 else \
3d458a81 110 $(LINK) $(guile_filter_doc_snarfage_OBJECTS) $(LDADD) $(gnulib_library) $(LIBS); \
b32fca0f
MV
111 fi
112
549436de
JB
113
114guile_SOURCES = guile.c
bfb2e113 115guile_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
44602b08 116guile_LDADD = libguile-@GUILE_EFFECTIVE_VERSION@.la
de7d32d0 117guile_LDFLAGS = $(GUILE_CFLAGS)
5bbc5359 118
44602b08 119libguile_@GUILE_EFFECTIVE_VERSION@_la_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
ee2a8b9b 120
44602b08 121libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = \
a4a0d399
AW
122 alist.c \
123 arbiters.c \
c53c0893 124 array-handle.c \
5d1b3b2d 125 array-map.c \
2fa901a5 126 arrays.c \
a4a0d399
AW
127 async.c \
128 backtrace.c \
129 boolean.c \
cf396142 130 bitvectors.c \
a4a0d399
AW
131 bytevectors.c \
132 chars.c \
b9c100d0 133 control.c \
a4a0d399
AW
134 continuations.c \
135 debug.c \
136 deprecated.c \
137 deprecation.c \
9ede013f 138 dynstack.c \
a4a0d399
AW
139 dynwind.c \
140 eq.c \
141 error.c \
142 eval.c \
143 evalext.c \
dc3e203e 144 expand.c \
a4a0d399
AW
145 extensions.c \
146 feature.c \
073167ef 147 filesys.c \
6e9ec86d 148 finalizers.c \
a4a0d399 149 fluids.c \
e2c2a699 150 foreign.c \
a7ee7f7c 151 foreign-object.c \
a4a0d399
AW
152 fports.c \
153 frames.c \
a4a0d399 154 gc-malloc.c \
a4a0d399 155 gc.c \
a4a0d399 156 gettext.c \
1030b450 157 generalized-arrays.c \
f332e957 158 generalized-vectors.c \
a4a0d399
AW
159 goops.c \
160 gsubr.c \
161 guardians.c \
162 hash.c \
163 hashtab.c \
164 hooks.c \
756e8a3a 165 i18n.c \
a4a0d399
AW
166 init.c \
167 inline.c \
168 instructions.c \
169 ioext.c \
170 keywords.c \
a4a0d399
AW
171 list.c \
172 load.c \
4cbc95f1 173 loader.c \
a4a0d399
AW
174 macros.c \
175 mallocs.c \
b7742c6b 176 memoize.c \
a4a0d399
AW
177 modules.c \
178 null-threads.c \
179 numbers.c \
a4a0d399
AW
180 objprop.c \
181 options.c \
182 pairs.c \
6f81b18a 183 poll.c \
a4a0d399
AW
184 ports.c \
185 print.c \
186 procprop.c \
187 procs.c \
188 programs.c \
7b893819 189 promises.c \
a4a0d399 190 r6rs-ports.c \
a4a0d399
AW
191 random.c \
192 rdelim.c \
193 read.c \
194 root.c \
195 rw.c \
196 scmsigs.c \
197 script.c \
198 simpos.c \
199 smob.c \
200 sort.c \
201 srcprop.c \
37710f7e
AW
202 srfi-1.c \
203 srfi-4.c \
a4a0d399
AW
204 srfi-13.c \
205 srfi-14.c \
37710f7e 206 srfi-60.c \
a4a0d399
AW
207 stackchk.c \
208 stacks.c \
209 stime.c \
210 strings.c \
211 strorder.c \
212 strports.c \
213 struct.c \
214 symbols.c \
215 threads.c \
216 throw.c \
0f458a37 217 trees.c \
476b894c 218 uniform.c \
a4a0d399
AW
219 values.c \
220 variable.c \
221 vectors.c \
222 version.c \
223 vm.c \
224 vports.c \
26b26354 225 weak-set.c \
7005c60f 226 weak-table.c \
a141db86 227 weak-vector.c
83495480 228
a4a0d399
AW
229DOT_X_FILES = \
230 alist.x \
231 arbiters.x \
c53c0893 232 array-handle.x \
5d1b3b2d 233 array-map.x \
2fa901a5 234 arrays.x \
a4a0d399
AW
235 async.x \
236 backtrace.x \
237 boolean.x \
cf396142 238 bitvectors.x \
a4a0d399
AW
239 bytevectors.x \
240 chars.x \
b9c100d0 241 control.x \
a4a0d399
AW
242 continuations.x \
243 debug.x \
244 deprecated.x \
245 deprecation.x \
a4a0d399
AW
246 dynl.x \
247 dynwind.x \
248 eq.x \
249 error.x \
250 eval.x \
251 evalext.x \
dc3e203e 252 expand.x \
a4a0d399
AW
253 extensions.x \
254 feature.x \
ee037cee 255 filesys.x \
a4a0d399 256 fluids.x \
e2c2a699 257 foreign.x \
a4a0d399 258 fports.x \
4cbc95f1 259 frames.x \
a4a0d399 260 gc-malloc.x \
a4a0d399
AW
261 gc.x \
262 gettext.x \
1030b450 263 generalized-arrays.x \
f332e957 264 generalized-vectors.x \
a4a0d399
AW
265 goops.x \
266 gsubr.x \
267 guardians.x \
268 hash.x \
269 hashtab.x \
270 hooks.x \
271 i18n.x \
272 init.x \
4cbc95f1 273 instructions.x \
a4a0d399
AW
274 ioext.x \
275 keywords.x \
a4a0d399
AW
276 list.x \
277 load.x \
4cbc95f1 278 loader.x \
a4a0d399
AW
279 macros.x \
280 mallocs.x \
b7742c6b 281 memoize.x \
a4a0d399
AW
282 modules.x \
283 numbers.x \
a4a0d399
AW
284 objprop.x \
285 options.x \
286 pairs.x \
287 ports.x \
288 print.x \
289 procprop.x \
290 procs.x \
4cbc95f1 291 programs.x \
7b893819 292 promises.x \
a4a0d399 293 r6rs-ports.x \
a4a0d399
AW
294 random.x \
295 rdelim.x \
296 read.x \
297 root.x \
298 rw.x \
299 scmsigs.x \
300 script.x \
301 simpos.x \
302 smob.x \
303 sort.x \
304 srcprop.x \
37710f7e
AW
305 srfi-1.x \
306 srfi-4.x \
a4a0d399
AW
307 srfi-13.x \
308 srfi-14.x \
37710f7e 309 srfi-60.x \
a4a0d399
AW
310 stackchk.x \
311 stacks.x \
312 stime.x \
313 strings.x \
314 strorder.x \
315 strports.x \
316 struct.x \
317 symbols.x \
318 threads.x \
319 throw.x \
0f458a37 320 trees.x \
476b894c 321 uniform.x \
a4a0d399
AW
322 values.x \
323 variable.x \
324 vectors.x \
325 version.x \
4cbc95f1 326 vm.x \
a4a0d399 327 vports.x \
26b26354 328 weak-set.x \
7005c60f 329 weak-table.x \
a141db86 330 weak-vector.x
8bee78b3 331
e9e225e5 332EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
8bee78b3 333
a4a0d399
AW
334DOT_DOC_FILES = \
335 alist.doc \
336 arbiters.doc \
c53c0893 337 array-handle.doc \
5d1b3b2d 338 array-map.doc \
2fa901a5 339 arrays.doc \
a4a0d399
AW
340 async.doc \
341 backtrace.doc \
342 boolean.doc \
cf396142 343 bitvectors.doc \
a4a0d399
AW
344 bytevectors.doc \
345 chars.doc \
b9c100d0 346 control.doc \
a4a0d399
AW
347 continuations.doc \
348 debug.doc \
349 deprecated.doc \
350 deprecation.doc \
a4a0d399
AW
351 dynl.doc \
352 dynwind.doc \
353 eq.doc \
354 error.doc \
355 eval.doc \
356 evalext.doc \
dc3e203e 357 expand.doc \
a4a0d399
AW
358 extensions.doc \
359 feature.doc \
073167ef 360 filesys.doc \
a4a0d399 361 fluids.doc \
e2c2a699 362 foreign.doc \
a4a0d399 363 fports.doc \
a4a0d399 364 gc-malloc.doc \
a4a0d399
AW
365 gc.doc \
366 gettext.doc \
1030b450 367 generalized-arrays.doc \
476b894c 368 generalized-vectors.doc \
a4a0d399
AW
369 goops.doc \
370 gsubr.doc \
371 guardians.doc \
372 hash.doc \
373 hashtab.doc \
374 hooks.doc \
375 i18n.doc \
376 init.doc \
377 ioext.doc \
378 keywords.doc \
a4a0d399
AW
379 list.doc \
380 load.doc \
381 macros.doc \
382 mallocs.doc \
b7742c6b 383 memoize.doc \
a4a0d399
AW
384 modules.doc \
385 numbers.doc \
a4a0d399
AW
386 objprop.doc \
387 options.doc \
388 pairs.doc \
389 ports.doc \
390 print.doc \
391 procprop.doc \
392 procs.doc \
7b893819 393 promises.doc \
a4a0d399 394 r6rs-ports.doc \
a4a0d399
AW
395 random.doc \
396 rdelim.doc \
397 read.doc \
398 root.doc \
399 rw.doc \
400 scmsigs.doc \
401 script.doc \
402 simpos.doc \
403 smob.doc \
404 sort.doc \
405 srcprop.doc \
37710f7e
AW
406 srfi-1.doc \
407 srfi-4.doc \
a4a0d399
AW
408 srfi-13.doc \
409 srfi-14.doc \
37710f7e 410 srfi-60.doc \
a4a0d399
AW
411 stackchk.doc \
412 stacks.doc \
413 stime.doc \
414 strings.doc \
415 strorder.doc \
416 strports.doc \
417 struct.doc \
418 symbols.doc \
419 threads.doc \
420 throw.doc \
0f458a37 421 trees.doc \
476b894c 422 uniform.doc \
a4a0d399
AW
423 values.doc \
424 variable.doc \
425 vectors.doc \
426 version.doc \
427 vports.doc \
26b26354 428 weak-set.doc \
7005c60f 429 weak-table.doc \
a141db86 430 weak-vector.doc
a3365d47 431
2ce88b54 432EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
9515eae6 433
510ca126
AW
434vm-operations.h: vm-engine.c
435 @echo '/* This file was generated automatically from $<; do not' > $@
436 @echo ' edit. See the source file for copyright information. */' >> $@
437 @echo '' >> $@
438 @echo "#define FOR_EACH_VM_OPERATION(M) \\" >> $@
439 $(AM_V_GEN)$(GREP) '^ *VM_DEFINE_OP' $< \
440 | sed -e 's,VM_DEFINE_OP (\(.*\)).*, M (\1) \\,' >> $@
441 @echo '' >> $@
442
648da032 443BUILT_SOURCES = cpp-E.c cpp-SIG.c libpath.h \
b405cdb4 444 scmconfig.h \
510ca126 445 $(DOT_I_FILES) vm-operations.h $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
9515eae6 446
c5c7c114
LC
447# Force the generation of `guile-procedures.texi' because the top-level
448# Makefile expects it to be built.
449all-local: guile-procedures.texi
450
44602b08 451EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \
c32b39b9 452 memmove.c strerror.c \
f731051e 453 dynl.c regex-posix.c \
073167ef 454 posix.c net_db.c socket.c \
29627818 455 debug-malloc.c mkstemp.c \
09b204d3 456 win32-uname.c \
b89c4943 457 locale-categories.h
7bfd3b9e 458
413a1367
ML
459## delete guile-snarf.awk from the installation bindir, in case it's
460## lingering there due to an earlier guile version not having been
461## wiped out.
462install-exec-hook:
b27b814d 463 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
413a1367 464
475772ea 465install-data-hook: libguile-2.2-gdb.scm
359f46a4 466 @$(MKDIR_P) $(DESTDIR)$(libdir)
475772ea 467## We want to install libguile-2.2-gdb.scm as SOMETHING-gdb.scm.
359f46a4
LC
468## SOMETHING is the full name of the final library. We want to ignore
469## symlinks, the .la file, and any previous -gdb.py file. This is
470## inherently fragile, but there does not seem to be a better option,
471## because libtool hides the real names from us. (Trick courtesy of
472## GNU libstdc++.)
473 @here=`pwd`; cd $(DESTDIR)$(libdir); \
474 for file in libguile-@GUILE_EFFECTIVE_VERSION@*; do \
475 case $$file in \
476 *-gdb.scm) ;; \
477 *.la) ;; \
478 *) if test -h $$file; then \
479 continue; \
480 fi; \
481 libname=$$file;; \
482 esac; \
483 done; \
484 cd $$here; \
a8b80d6b 485 echo " $(INSTALL_DATA) $< \
359f46a4 486$(DESTDIR)$(libdir)/$$libname-gdb.scm"; \
a8b80d6b
LC
487 $(INSTALL_DATA) "$<" \
488 "$(DESTDIR)$(libdir)/$$libname-gdb.scm"
359f46a4 489
21a7ba9b
LC
490# Remove the GDB support file and the Info 'dir' file that
491# 'install-info' 5.x installs.
492uninstall-hook:
493 -rm "$(DESTDIR)$(libdir)/libguile-@GUILE_EFFECTIVE_VERSION@"*-gdb.scm
494 -rm -f "$(DESTDIR)$(infodir)/dir"
495
7bfd3b9e 496## This is kind of nasty... there are ".c" files that we don't want to
1be6b49c
ML
497## compile, since they are #included. So instead we list them here.
498## Perhaps we can deal with them normally once the merge seems to be
499## working.
4b126598 500noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
afc74c29 501 elf.h \
71560395 502 srfi-14.i.c \
06f9c814 503 quicksort.i.c \
09b204d3 504 win32-uname.h \
87fc4596 505 private-options.h ports-internal.h
7bfd3b9e 506
83495480 507# vm instructions
1c33be99 508noinst_HEADERS += vm-engine.c
83495480 509
44602b08 510libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES = @LIBLOBJS@
abd7e37a 511
18f2d5aa 512libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD = \
cae0945c
LC
513 @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) $(LTLIBLTDL)
514
515# Libtool version info.
516version_info = @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@
517
518libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS = \
519 $(BDW_GC_LIBS) $(LIBFFI_LIBS) \
dd36ce77 520 $(CEIL_LIBM) \
cae0945c 521 $(FLOOR_LIBM) \
dd36ce77 522 $(FREXP_LIBM) \
cae0945c
LC
523 $(GETADDRINFO_LIB) \
524 $(HOSTENT_LIB) \
525 $(INET_NTOP_LIB) \
526 $(INET_PTON_LIB) \
527 $(ISNAND_LIBM) \
528 $(ISNANF_LIBM) \
529 $(ISNANL_LIBM) \
dd36ce77 530 $(LDEXP_LIBM) \
cae0945c 531 $(LIBSOCKET) \
235c2804 532 $(LIB_CLOCK_GETTIME) \
cae0945c 533 $(LOG1P_LIBM) \
005de2e8 534 $(LOG_LIBM) \
cae0945c
LC
535 $(LTLIBICONV) \
536 $(LTLIBINTL) \
537 $(LTLIBUNISTRING) \
005de2e8 538 $(ROUND_LIBM) \
cae0945c
LC
539 $(SERVENT_LIB) \
540 $(TRUNC_LIBM) \
541 -version-info $(version_info) \
542 -export-dynamic -no-undefined \
76e8a758 543 $(GNU_LD_FLAGS)
733943b9 544
9af080f7
LC
545if HAVE_LD_VERSION_SCRIPT
546
44602b08 547libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS += -Wl,--version-script="$(srcdir)/libguile.map"
9af080f7
LC
548
549endif HAVE_LD_VERSION_SCRIPT
550
551
54f16aec 552# These are headers visible as <guile/mumble.h>
6a6df187 553pkginclude_HEADERS =
ee2a8b9b 554
733943b9 555# These are headers visible as <libguile/mumble.h>.
718815d7 556modincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)/libguile
a4a0d399
AW
557modinclude_HEADERS = \
558 __scm.h \
559 alist.h \
560 arbiters.h \
c53c0893 561 array-handle.h \
5d1b3b2d 562 array-map.h \
2fa901a5 563 arrays.h \
a4a0d399
AW
564 async.h \
565 backtrace.h \
1c44468d 566 bdw-gc.h \
a4a0d399 567 boolean.h \
cf396142 568 bitvectors.h \
a4a0d399
AW
569 bytevectors.h \
570 chars.h \
b9c100d0 571 control.h \
a4a0d399
AW
572 continuations.h \
573 debug-malloc.h \
574 debug.h \
575 deprecated.h \
576 deprecation.h \
a4a0d399 577 dynl.h \
9ede013f 578 dynstack.h \
a4a0d399
AW
579 dynwind.h \
580 eq.h \
581 error.h \
582 eval.h \
583 evalext.h \
dc3e203e 584 expand.h \
a4a0d399
AW
585 extensions.h \
586 feature.h \
6e9ec86d 587 finalizers.h \
a4a0d399
AW
588 filesys.h \
589 fluids.h \
e2c2a699 590 foreign.h \
a7ee7f7c 591 foreign-object.h \
a4a0d399
AW
592 fports.h \
593 frames.h \
a4a0d399 594 gc.h \
a4a0d399 595 gettext.h \
1030b450 596 generalized-arrays.h \
f332e957 597 generalized-vectors.h \
a4a0d399
AW
598 goops.h \
599 gsubr.h \
600 guardians.h \
601 hash.h \
602 hashtab.h \
603 hooks.h \
604 i18n.h \
605 init.h \
606 inline.h \
607 instructions.h \
608 ioext.h \
609 iselect.h \
610 keywords.h \
a4a0d399
AW
611 list.h \
612 load.h \
4cbc95f1 613 loader.h \
a4a0d399
AW
614 macros.h \
615 mallocs.h \
b7742c6b 616 memoize.h \
a4a0d399
AW
617 modules.h \
618 net_db.h \
619 null-threads.h \
620 numbers.h \
a4a0d399
AW
621 objprop.h \
622 options.h \
623 pairs.h \
6f81b18a 624 poll.h \
a4a0d399
AW
625 ports.h \
626 posix.h \
627 print.h \
628 procprop.h \
629 procs.h \
630 programs.h \
7b893819 631 promises.h \
a4a0d399
AW
632 pthread-threads.h \
633 r6rs-ports.h \
a4a0d399
AW
634 random.h \
635 rdelim.h \
636 read.h \
637 regex-posix.h \
638 root.h \
639 rw.h \
640 scmsigs.h \
641 script.h \
642 simpos.h \
643 smob.h \
644 snarf.h \
645 socket.h \
646 sort.h \
647 srcprop.h \
37710f7e
AW
648 srfi-1.h \
649 srfi-4.h \
a4a0d399
AW
650 srfi-13.h \
651 srfi-14.h \
37710f7e 652 srfi-60.h \
a4a0d399
AW
653 stackchk.h \
654 stacks.h \
655 stime.h \
656 strings.h \
657 strorder.h \
658 strports.h \
659 struct.h \
660 symbols.h \
661 tags.h \
662 threads.h \
663 throw.h \
0f458a37 664 trees.h \
a4a0d399 665 validate.h \
476b894c 666 uniform.h \
a4a0d399
AW
667 values.h \
668 variable.h \
669 vectors.h \
486013d6 670 vm-builtins.h \
a4a0d399
AW
671 vm-expand.h \
672 vm.h \
673 vports.h \
26b26354 674 weak-set.h \
7005c60f 675 weak-table.h \
a141db86 676 weak-vector.h
83495480 677
93ff93f6 678nodist_modinclude_HEADERS = version.h scmconfig.h
733943b9 679
604a672e
TTN
680bin_SCRIPTS = guile-snarf
681
f94b6524
TTN
682# We can re-enable install for some of these if/when they are documented
683# and people feel like maintaining them. For now, this is not the case.
2d6a14ad 684noinst_SCRIPTS = guile-snarf-docs
adb75a41 685
359f46a4
LC
686EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
687 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 \
688 guile-func-name-check \
689 cpp-E.syms cpp-E.c cpp-SIG.syms cpp-SIG.c \
690 c-tokenize.lex \
691 scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map \
475772ea 692 libguile-2.2-gdb.scm
c99f9605
ML
693# $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
694# guile-procedures.txt guile.texi
733943b9 695
fef07353 696## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
90ff3ec5 697libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
e151bee6
JB
698 @rm -f libpath.tmp
699 @echo '/* generated by Makefile */' > libpath.tmp
700 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
d8a20ddb 701 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
d5a1a8cd 702 @echo '#define SCM_SITE_DIR "$(sitedir)"' >> libpath.tmp
bc325e76 703 @echo '#define SCM_GLOBAL_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
28af5ee5
AW
704 @echo '#define SCM_LIB_DIR "$(libdir)"' >> libpath.tmp
705 @echo '#define SCM_EXTENSIONS_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions"' >> libpath.tmp
5b197db8 706 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
9957641b 707 @echo '#define SCM_SITE_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache"' >> libpath.tmp
5b197db8 708 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
e151bee6
JB
709 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
710 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
c565712c 711 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
e151bee6
JB
712 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
713 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
714 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
715 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
716 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
717 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
718 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
719 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
720 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
721 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
5b197db8 722 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
e151bee6
JB
723 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
724 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
725 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
eb350124
AW
726 @echo ' { "pkgdatadir", "$(pkgdatadir)" }, \' >> libpath.tmp
727 @echo ' { "pkglibdir", "$(pkglibdir)" }, \' >> libpath.tmp
728 @echo ' { "pkgincludedir", "$(pkgincludedir)" }, \' \
e151bee6 729 >> libpath.tmp
869bfe86 730 @echo ' { "extensiondir", "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions" }, \' >> libpath.tmp
b6fae158 731 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
54f16aec
TTN
732 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
733 >> libpath.tmp
30dda257 734 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
5bbc5359 735 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
a6025413 736 @echo ' { "buildstamp", "'`date -u +'%Y-%m-%d %T'`'" }, \' >> libpath.tmp
e151bee6 737 @echo '}' >> libpath.tmp
a572fc95 738 $(AM_V_GEN)mv libpath.tmp libpath.h
733943b9 739
3dc81fba 740
4e331f9e 741snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS)
e9c3d3f9 742
3dc81fba 743SUFFIXES = .x .doc
a572fc95 744
733943b9 745.c.x:
a572fc95 746 $(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts)
c99f9605 747.c.doc:
e6d67f1e 748 $(AM_V_SNARF)./guile-snarf-docs -o $@ $< -- $(snarfcppopts)
733943b9 749
f9560a34 750$(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in version.h
c99f9605 751
23f2b9a3 752$(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
66418d34 753
648da032
TTN
754error.x: cpp-E.c
755posix.x: cpp-SIG.c
faf6a29b 756load.x: libpath.h
0bc37aec 757dynl.x: libpath.h
faf6a29b 758
f8241358 759alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
b8b06598 760snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guild snarf-check-and-output-texi
f8241358
TTN
761dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
762
2e945bcc 763guile.texi: $(alldotdocfiles) guile$(EXEEXT)
f8241358
TTN
764 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
765
2e945bcc 766guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
a572fc95 767 $(AM_V_GEN)$(dotdoc2texi) > $@ || { rm $@; false; }
9d29e990 768
30e3be5a 769c-tokenize.c: c-tokenize.lex
47ac1e47 770 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
30e3be5a 771
733943b9 772## Add -MG to make the .x magic work with auto-dep code.
47871d5a 773MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
ee78fbb0 774
648da032
TTN
775\f
776# This page is for maintenance of the lists of CPP symbols that are eventually
777# included in error.c (‘errno’ values: E*) and posix.c (signal names: SIG*),
778# in the funcs scm_init_{error,posix}, respectively.
779#
780# The lists (files cpp-{E,SIG}.syms) are not included verbatim, but processed
781# (via pattern rule ‘.syms.c’ below) so that each CPP symbol is transformed to
782# fragment of #ifdef'd C code that defines a Scheme variable of the same name.
783# The resulting files, cpp-{E,SIG}.c, are the ones #include:d.
784#
785# To maintain the (source) lists of symbols, we use a GCC-specific feature
786# to list all symbols #define:d when expanding <{errno,signal}.h>, grep
787# the output for {E,SIG}*, massage the result into a usable form, and
788# construct a union of the current and new symbols. This is written to
789# files cpp-{E,SIG}.syms.NEW for review. If things look ok, you can then
790# "mv foo.NEW foo" and commit. Generating the foo.NEW files and showing
791# an informative message is the job of targets chknew-{E,SIG}.
792
793# For each line in foo.syms, transform:
794# SYMBOL
795# to:
796# #ifdef SYMBOL
797# scm_c_define ("SYMBOL", scm_from_int (SYMBOL));
798# #endif
319b53dd
TTN
799# writing output to foo.c. We use a while-read loop instead of a
800# one-line sed script because some seds (e.g., FreeBSD) don't read
801# '\n' as a newline (like GNU sed does). Sad, but true.
648da032 802.syms.c:
bfebf099 803 $(AM_V_GEN) \
319b53dd
TTN
804 cat $< | while read sym ; do \
805 echo "#ifdef $$sym" ; \
806 echo "scm_c_define (\"$$sym\", scm_from_int ($$sym));" ; \
807 echo "#endif" ; \
808 done > $@T
bfebf099 809 @mv $@T $@
648da032
TTN
810
811# Write $(srcdir)/cpp-{E,SIG}.syms.NEW if there are any not-yet-seen
812# ("new" to us) E* or SIG* symbols in <errno.h> or <signal.h>, respectively.
9253d090 813chknew-E chknew-SIG: \
648da032
TTN
814 @bit=`echo $@ | sed s/^chknew-//` ; \
815 old="$(srcdir)/cpp-$$bit.syms" ; \
816 echo "#include <$${bit}.h>" \
817 | sed 's/E/errno/;s/SIG/signal/' \
9253d090 818 | gcc -dM -E - \
648da032
TTN
819 | sed 's/^#define //;/^'$$bit'[A-Z][A-Z]*/!d;s/ .*//' \
820 | sort | diff -u $$old - | sed '1,2d;/^+/!d;s/^.//' \
821 > TMP ; \
822 if [ -s TMP ] ; then new="$$old.NEW" ; \
823 cat $$old TMP | sort > $$new ; \
824 echo "$$new: `sed -n '$$=' TMP` new symbol(s)." ; \
825 sed 's/^/ /' TMP ; \
826 else echo "No new symbols found." ; \
827 fi ; rm TMP
828
829\f
67ec3667 830
ad6b30a0 831MOSTLYCLEANFILES = \
23ccb831 832 scmconfig.h scmconfig.h.tmp
ad6b30a0 833
1c33be99 834CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi
ee0c0e03
ML
835
836MAINTAINERCLEANFILES = c-tokenize.c