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