add wind-fluids, unwind-fluids VM ops
[bpt/guile.git] / libguile / Makefile.am
CommitLineData
733943b9 1## Process this file with Automake to create Makefile.in
2764bd99 2##
e2c2a699 3## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
2764bd99
JB
4##
5## This file is part of GUILE.
54f16aec 6##
53befeb7
NJ
7## GUILE is free software; you can redistribute it and/or modify it
8## under the terms of the GNU Lesser General Public License as
9## published by the Free Software Foundation; either version 3, or
2764bd99 10## (at your option) any later version.
54f16aec 11##
2764bd99
JB
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
53befeb7 15## GNU Lesser General Public License for more details.
54f16aec 16##
53befeb7
NJ
17## You should have received a copy of the GNU Lesser General Public
18## License along with GUILE; see the file COPYING.LESSER. If not,
19## write to the Free Software Foundation, Inc., 51 Franklin Street,
20## Fifth Floor, Boston, MA 02110-1301 USA
733943b9 21
3307df95 22AUTOMAKE_OPTIONS = gnu
733943b9 23
a0599745 24## Prevent automake from adding extra -I options
8f99e3f3 25DEFS = @DEFS@
535b3592
LC
26
27# Override Automake's `DEFAULT_INCLUDES'. By default, it contains
28# "-I$(srcdir)", which causes problems on Tru64 where our "random.h"
29# is picked up by <stdlib.h> instead of the libc's <random.h>.
30DEFAULT_INCLUDES =
31
733943b9
TT
32## Check for headers in $(srcdir)/.., so that #include
33## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
6caac03c 34## building. Also look for Gnulib headers in `lib'.
442f3f20 35AM_CPPFLAGS = -DBUILDING_LIBGUILE=1 -I$(top_srcdir) -I$(top_builddir) \
d8b04f04 36 -I$(top_srcdir)/lib -I$(top_builddir)/lib $(LIBFFI_CFLAGS)
6caac03c 37
d8b04f04 38AM_CFLAGS = $(GCC_CFLAGS) $(CFLAG_VISIBILITY)
6caac03c
LC
39
40## The Gnulib Libtool archive.
41gnulib_library = $(top_builddir)/lib/libgnu.la
733943b9 42
4079f87e 43ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
abc049a9 44 --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
fef07353 45
756e8a3a 46lib_LTLIBRARIES = libguile.la
f94b6524 47bin_PROGRAMS = guile
b32fca0f 48
64c2db80
RB
49noinst_PROGRAMS = guile_filter_doc_snarfage gen-scmconfig
50
51gen_scmconfig_SOURCES = gen-scmconfig.c
52
53## Override default rule; this should be compiled for BUILD host.
54## For some reason, OBJEXT does not include the dot
55gen-scmconfig.$(OBJEXT): gen-scmconfig.c
56 if [ "$(cross_compiling)" = "yes" ]; then \
47871d5a 57 $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) -c -o $@ $<; \
64c2db80
RB
58 else \
59 $(COMPILE) -c -o $@ $<; \
60 fi
61
2e945bcc
SJ
62## Override default rule; this should run on BUILD host.
63gen-scmconfig$(EXEEXT): $(gen_scmconfig_OBJECTS) $(gen_scmconfig_DEPENDENCIES)
64 @rm -f gen-scmconfig$(EXEEXT)
65 if [ "$(cross_compiling)" = "yes" ]; then \
66 $(CCLD_FOR_BUILD) -o $@ $(gen_scmconfig_OBJECTS); \
67 else \
68 $(LINK) $(gen_scmconfig_OBJECTS) $(LDADD) $(LIBS); \
69 fi
70
71scmconfig.h: ${top_builddir}/config.h gen-scmconfig$(EXEEXT)
64c2db80 72 rm -f scmconfig.h.tmp
eaf94f77 73 cat $(srcdir)/scmconfig.h.top > scmconfig.h.tmp
2e945bcc 74 ./gen-scmconfig$(EXEEXT) >> scmconfig.h.tmp
64c2db80
RB
75 chmod 444 scmconfig.h.tmp
76 rm -f scmconfig.h
77 mv scmconfig.h.tmp scmconfig.h
78
b32fca0f
MV
79guile_filter_doc_snarfage_SOURCES = c-tokenize.c
80
81## Override default rule; this should be compiled for BUILD host.
82## For some reason, OBJEXT does not include the dot
83c-tokenize.$(OBJEXT): c-tokenize.c
84 if [ "$(cross_compiling)" = "yes" ]; then \
47871d5a 85 $(CC_FOR_BUILD) $(DEFS) $(AM_CPPFLAGS) -c -o $@ $<; \
b32fca0f 86 else \
4ea57d5b 87 $(COMPILE) -c -o $@ $<; \
b32fca0f
MV
88 fi
89
90## Override default rule; this should run on BUILD host.
91guile_filter_doc_snarfage$(EXEEXT): $(guile_filter_doc_snarfage_OBJECTS) $(guile_filter_doc_snarfage_DEPENDENCIES)
92 @rm -f guile_filter_doc_snarfage$(EXEEXT)
93 if [ "$(cross_compiling)" = "yes" ]; then \
94 $(CCLD_FOR_BUILD) -o $@ $(guile_filter_doc_snarfage_OBJECTS); \
95 else \
96 $(LINK) $(guile_filter_doc_snarfage_OBJECTS) $(LDADD) $(LIBS); \
97 fi
98
549436de
JB
99
100guile_SOURCES = guile.c
bfb2e113 101guile_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
8f99e3f3 102guile_LDADD = libguile.la
de7d32d0 103guile_LDFLAGS = $(GUILE_CFLAGS)
5bbc5359 104
bfb2e113 105libguile_la_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
ee2a8b9b 106
a4a0d399
AW
107libguile_la_SOURCES = \
108 alist.c \
109 arbiters.c \
c53c0893 110 array-handle.c \
5d1b3b2d 111 array-map.c \
2fa901a5 112 arrays.c \
a4a0d399
AW
113 async.c \
114 backtrace.c \
115 boolean.c \
cf396142 116 bitvectors.c \
a4a0d399
AW
117 bytevectors.c \
118 chars.c \
b9c100d0 119 control.c \
a4a0d399
AW
120 continuations.c \
121 debug.c \
122 deprecated.c \
123 deprecation.c \
124 discouraged.c \
125 dynwind.c \
126 eq.c \
127 error.c \
128 eval.c \
129 evalext.c \
130 extensions.c \
131 feature.c \
132 fluids.c \
e2c2a699 133 foreign.c \
a4a0d399
AW
134 fports.c \
135 frames.c \
a4a0d399 136 gc-malloc.c \
a4a0d399 137 gc.c \
a4a0d399
AW
138 gdbint.c \
139 gettext.c \
1030b450 140 generalized-arrays.c \
f332e957 141 generalized-vectors.c \
a4a0d399
AW
142 goops.c \
143 gsubr.c \
144 guardians.c \
145 hash.c \
146 hashtab.c \
147 hooks.c \
756e8a3a 148 i18n.c \
a4a0d399
AW
149 init.c \
150 inline.c \
151 instructions.c \
152 ioext.c \
153 keywords.c \
154 lang.c \
155 list.c \
156 load.c \
157 macros.c \
158 mallocs.c \
b7742c6b 159 memoize.c \
a4a0d399
AW
160 modules.c \
161 null-threads.c \
162 numbers.c \
163 objcodes.c \
a4a0d399
AW
164 objprop.c \
165 options.c \
166 pairs.c \
167 ports.c \
168 print.c \
169 procprop.c \
170 procs.c \
171 programs.c \
7b893819 172 promises.c \
a4a0d399
AW
173 properties.c \
174 r6rs-ports.c \
a4a0d399
AW
175 random.c \
176 rdelim.c \
177 read.c \
178 root.c \
179 rw.c \
180 scmsigs.c \
181 script.c \
182 simpos.c \
183 smob.c \
184 sort.c \
185 srcprop.c \
186 srfi-13.c \
187 srfi-14.c \
188 srfi-4.c \
189 stackchk.c \
190 stacks.c \
191 stime.c \
192 strings.c \
193 strorder.c \
194 strports.c \
195 struct.c \
196 symbols.c \
197 threads.c \
198 throw.c \
0f458a37 199 trees.c \
476b894c 200 uniform.c \
a4a0d399
AW
201 values.c \
202 variable.c \
203 vectors.c \
204 version.c \
205 vm.c \
206 vports.c \
207 weaks.c
83495480 208
a4a0d399
AW
209DOT_X_FILES = \
210 alist.x \
211 arbiters.x \
c53c0893 212 array-handle.x \
5d1b3b2d 213 array-map.x \
2fa901a5 214 arrays.x \
a4a0d399
AW
215 async.x \
216 backtrace.x \
217 boolean.x \
cf396142 218 bitvectors.x \
a4a0d399
AW
219 bytevectors.x \
220 chars.x \
b9c100d0 221 control.x \
a4a0d399
AW
222 continuations.x \
223 debug.x \
224 deprecated.x \
225 deprecation.x \
226 discouraged.x \
227 dynl.x \
228 dynwind.x \
229 eq.x \
230 error.x \
231 eval.x \
232 evalext.x \
233 extensions.x \
234 feature.x \
235 fluids.x \
e2c2a699 236 foreign.x \
a4a0d399 237 fports.x \
a4a0d399 238 gc-malloc.x \
a4a0d399
AW
239 gc.x \
240 gettext.x \
1030b450 241 generalized-arrays.x \
f332e957 242 generalized-vectors.x \
a4a0d399
AW
243 goops.x \
244 gsubr.x \
245 guardians.x \
246 hash.x \
247 hashtab.x \
248 hooks.x \
249 i18n.x \
250 init.x \
251 ioext.x \
252 keywords.x \
253 lang.x \
254 list.x \
255 load.x \
256 macros.x \
257 mallocs.x \
b7742c6b 258 memoize.x \
a4a0d399
AW
259 modules.x \
260 numbers.x \
a4a0d399
AW
261 objprop.x \
262 options.x \
263 pairs.x \
264 ports.x \
265 print.x \
266 procprop.x \
267 procs.x \
7b893819 268 promises.x \
a4a0d399
AW
269 properties.x \
270 r6rs-ports.x \
a4a0d399
AW
271 random.x \
272 rdelim.x \
273 read.x \
274 root.x \
275 rw.x \
276 scmsigs.x \
277 script.x \
278 simpos.x \
279 smob.x \
280 sort.x \
281 srcprop.x \
282 srfi-13.x \
283 srfi-14.x \
284 srfi-4.x \
285 stackchk.x \
286 stacks.x \
287 stime.x \
288 strings.x \
289 strorder.x \
290 strports.x \
291 struct.x \
292 symbols.x \
293 threads.x \
294 throw.x \
0f458a37 295 trees.x \
476b894c 296 uniform.x \
a4a0d399
AW
297 values.x \
298 variable.x \
299 vectors.x \
300 version.x \
301 vports.x \
302 weaks.x
8bee78b3 303
83495480
AW
304# vm-related snarfs
305DOT_X_FILES += frames.x instructions.x objcodes.x programs.x vm.x
306
e9e225e5 307EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
8bee78b3 308
a4a0d399
AW
309DOT_DOC_FILES = \
310 alist.doc \
311 arbiters.doc \
c53c0893 312 array-handle.doc \
5d1b3b2d 313 array-map.doc \
2fa901a5 314 arrays.doc \
a4a0d399
AW
315 async.doc \
316 backtrace.doc \
317 boolean.doc \
cf396142 318 bitvectors.doc \
a4a0d399
AW
319 bytevectors.doc \
320 chars.doc \
b9c100d0 321 control.doc \
a4a0d399
AW
322 continuations.doc \
323 debug.doc \
324 deprecated.doc \
325 deprecation.doc \
326 discouraged.doc \
327 dynl.doc \
328 dynwind.doc \
329 eq.doc \
330 error.doc \
331 eval.doc \
332 evalext.doc \
333 extensions.doc \
334 feature.doc \
335 fluids.doc \
e2c2a699 336 foreign.doc \
a4a0d399 337 fports.doc \
a4a0d399 338 gc-malloc.doc \
a4a0d399
AW
339 gc.doc \
340 gettext.doc \
1030b450 341 generalized-arrays.doc \
476b894c 342 generalized-vectors.doc \
a4a0d399
AW
343 goops.doc \
344 gsubr.doc \
345 guardians.doc \
346 hash.doc \
347 hashtab.doc \
348 hooks.doc \
349 i18n.doc \
350 init.doc \
351 ioext.doc \
352 keywords.doc \
353 lang.doc \
354 list.doc \
355 load.doc \
356 macros.doc \
357 mallocs.doc \
b7742c6b 358 memoize.doc \
a4a0d399
AW
359 modules.doc \
360 numbers.doc \
a4a0d399
AW
361 objprop.doc \
362 options.doc \
363 pairs.doc \
364 ports.doc \
365 print.doc \
366 procprop.doc \
367 procs.doc \
7b893819 368 promises.doc \
a4a0d399
AW
369 properties.doc \
370 r6rs-ports.doc \
a4a0d399
AW
371 random.doc \
372 rdelim.doc \
373 read.doc \
374 root.doc \
375 rw.doc \
376 scmsigs.doc \
377 script.doc \
378 simpos.doc \
379 smob.doc \
380 sort.doc \
381 srcprop.doc \
382 srfi-13.doc \
383 srfi-14.doc \
384 srfi-4.doc \
385 stackchk.doc \
386 stacks.doc \
387 stime.doc \
388 strings.doc \
389 strorder.doc \
390 strports.doc \
391 struct.doc \
392 symbols.doc \
393 threads.doc \
394 throw.doc \
0f458a37 395 trees.doc \
476b894c 396 uniform.doc \
a4a0d399
AW
397 values.doc \
398 variable.doc \
399 vectors.doc \
400 version.doc \
401 vports.doc \
402 weaks.doc
a3365d47 403
2ce88b54 404EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
9515eae6 405
83495480
AW
406DOT_I_FILES = vm-i-system.i vm-i-scheme.i vm-i-loader.i
407
408.c.i:
5c146363 409 $(GREP) '^VM_DEFINE' $< > $@
83495480 410
64c2db80
RB
411BUILT_SOURCES = cpp_err_symbols.c cpp_sig_symbols.c libpath.h \
412 version.h scmconfig.h \
83495480 413 $(DOT_I_FILES) $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
9515eae6 414
f731051e 415EXTRA_libguile_la_SOURCES = _scm.h \
c32b39b9 416 memmove.c strerror.c \
f731051e
MV
417 dynl.c regex-posix.c \
418 filesys.c posix.c net_db.c socket.c \
29627818 419 debug-malloc.c mkstemp.c \
b89c4943
LC
420 win32-uname.c win32-dirent.c win32-socket.c \
421 locale-categories.h
7bfd3b9e 422
413a1367
ML
423## delete guile-snarf.awk from the installation bindir, in case it's
424## lingering there due to an earlier guile version not having been
425## wiped out.
426install-exec-hook:
b27b814d 427 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
413a1367 428
7bfd3b9e 429## This is kind of nasty... there are ".c" files that we don't want to
1be6b49c
ML
430## compile, since they are #included. So instead we list them here.
431## Perhaps we can deal with them normally once the merge seems to be
432## working.
4b126598 433noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
71560395 434 ieee-754.h \
71560395 435 srfi-14.i.c \
06f9c814 436 quicksort.i.c \
340c49bf 437 win32-uname.h win32-dirent.h win32-socket.h \
981ff600 438 private-gc.h private-options.h
7bfd3b9e 439
83495480
AW
440# vm instructions
441noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
442
78bda5f3 443libguile_la_DEPENDENCIES = @LIBLOBJS@
f29ded4b
LC
444libguile_la_LIBADD = \
445 @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) \
2bfa4d5c 446 $(LTLIBUNISTRING) $(LTLIBICONV) $(LTLIBINTL)
61cd9dc9
LC
447libguile_la_LDFLAGS = \
448 @LTLIBINTL@ $(LIBFFI_LIBS) $(INET_NTOP_LIB) $(INET_PTON_LIB) \
449 $(GETADDRINFO_LIB) $(HOSTENT_LIB) $(SERVENT_LIB) \
76e8a758 450 -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ \
61cd9dc9 451 -export-dynamic -no-undefined \
76e8a758 452 $(GNU_LD_FLAGS)
733943b9 453
9af080f7
LC
454if HAVE_LD_VERSION_SCRIPT
455
456libguile_la_LDFLAGS += -Wl,--version-script="$(srcdir)/libguile.map"
457
458endif HAVE_LD_VERSION_SCRIPT
459
460
54f16aec 461# These are headers visible as <guile/mumble.h>
89bc270d 462pkginclude_HEADERS =
ee2a8b9b 463
733943b9 464# These are headers visible as <libguile/mumble.h>.
5380de6b 465modincludedir = $(includedir)/libguile
a4a0d399
AW
466modinclude_HEADERS = \
467 __scm.h \
468 alist.h \
469 arbiters.h \
c53c0893 470 array-handle.h \
5d1b3b2d 471 array-map.h \
2fa901a5 472 arrays.h \
a4a0d399
AW
473 async.h \
474 backtrace.h \
1c44468d 475 bdw-gc.h \
a4a0d399 476 boolean.h \
cf396142 477 bitvectors.h \
a4a0d399
AW
478 bytevectors.h \
479 chars.h \
b9c100d0 480 control.h \
a4a0d399
AW
481 continuations.h \
482 debug-malloc.h \
483 debug.h \
484 deprecated.h \
485 deprecation.h \
486 discouraged.h \
487 dynl.h \
488 dynwind.h \
489 eq.h \
490 error.h \
491 eval.h \
492 evalext.h \
493 extensions.h \
494 feature.h \
495 filesys.h \
496 fluids.h \
e2c2a699 497 foreign.h \
a4a0d399
AW
498 fports.h \
499 frames.h \
a4a0d399
AW
500 gc.h \
501 gdb_interface.h \
502 gdbint.h \
503 gettext.h \
1030b450 504 generalized-arrays.h \
f332e957 505 generalized-vectors.h \
a4a0d399
AW
506 goops.h \
507 gsubr.h \
508 guardians.h \
509 hash.h \
510 hashtab.h \
511 hooks.h \
512 i18n.h \
513 init.h \
514 inline.h \
515 instructions.h \
516 ioext.h \
517 iselect.h \
518 keywords.h \
519 lang.h \
520 list.h \
521 load.h \
522 macros.h \
523 mallocs.h \
b7742c6b 524 memoize.h \
a4a0d399
AW
525 modules.h \
526 net_db.h \
527 null-threads.h \
528 numbers.h \
529 objcodes.h \
a4a0d399
AW
530 objprop.h \
531 options.h \
532 pairs.h \
533 ports.h \
534 posix.h \
535 print.h \
536 procprop.h \
537 procs.h \
538 programs.h \
7b893819 539 promises.h \
a4a0d399
AW
540 properties.h \
541 pthread-threads.h \
542 r6rs-ports.h \
a4a0d399
AW
543 random.h \
544 rdelim.h \
545 read.h \
546 regex-posix.h \
547 root.h \
548 rw.h \
549 scmsigs.h \
550 script.h \
551 simpos.h \
552 smob.h \
553 snarf.h \
554 socket.h \
555 sort.h \
556 srcprop.h \
557 srfi-13.h \
558 srfi-14.h \
559 srfi-4.h \
560 stackchk.h \
561 stacks.h \
562 stime.h \
563 strings.h \
564 strorder.h \
565 strports.h \
566 struct.h \
567 symbols.h \
568 tags.h \
569 threads.h \
570 throw.h \
0f458a37 571 trees.h \
a4a0d399 572 validate.h \
476b894c 573 uniform.h \
a4a0d399
AW
574 values.h \
575 variable.h \
576 vectors.h \
a4a0d399
AW
577 vm-engine.h \
578 vm-expand.h \
579 vm.h \
580 vports.h \
581 weaks.h
83495480 582
93ff93f6 583nodist_modinclude_HEADERS = version.h scmconfig.h
733943b9 584
604a672e
TTN
585bin_SCRIPTS = guile-snarf
586
f94b6524
TTN
587# We can re-enable install for some of these if/when they are documented
588# and people feel like maintaining them. For now, this is not the case.
604a672e 589noinst_SCRIPTS = guile-doc-snarf guile-snarf-docs guile-func-name-check
adb75a41 590
89bc270d 591EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
61db429e
LC
592 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 cpp_signal.c \
593 cpp_errno.c cpp_err_symbols.in cpp_err_symbols.c \
594 cpp_sig_symbols.c cpp_sig_symbols.in cpp_cnvt.awk \
595 c-tokenize.lex version.h.in \
f49dbcad 596 scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map
c99f9605
ML
597# $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
598# guile-procedures.txt guile.texi
733943b9 599
d8a20ddb
RB
600## We use @-...-@ as the substitution brackets here, instead of the
601## usual @...@, so autoconf doesn't go and substitute the values
602## directly into the left-hand sides of the sed substitutions. *sigh*
c66fe8a9 603version.h: version.h.in $(top_builddir)/config.status
8ab3d8a0 604 sed < $(srcdir)/version.h.in > $@.tmp \
d8a20ddb
RB
605 -e s:@-GUILE_MAJOR_VERSION-@:${GUILE_MAJOR_VERSION}: \
606 -e s:@-GUILE_MINOR_VERSION-@:${GUILE_MINOR_VERSION}: \
607 -e s:@-GUILE_MICRO_VERSION-@:${GUILE_MICRO_VERSION}:
608 mv $@.tmp $@
609
fef07353 610## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
90ff3ec5 611libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
54f16aec 612 @echo "Generating libpath.h..."
e151bee6
JB
613 @rm -f libpath.tmp
614 @echo '/* generated by Makefile */' > libpath.tmp
615 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
d8a20ddb 616 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
e151bee6 617 @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
28af5ee5
AW
618 @echo '#define SCM_LIB_DIR "$(libdir)"' >> libpath.tmp
619 @echo '#define SCM_EXTENSIONS_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions"' >> libpath.tmp
5b197db8
AW
620 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
621 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
e151bee6
JB
622 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
623 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
c565712c 624 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
e151bee6
JB
625 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
626 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
627 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
628 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
629 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
630 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
631 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
632 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
633 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
634 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
5b197db8 635 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
e151bee6
JB
636 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
637 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
638 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
eb350124
AW
639 @echo ' { "pkgdatadir", "$(pkgdatadir)" }, \' >> libpath.tmp
640 @echo ' { "pkglibdir", "$(pkglibdir)" }, \' >> libpath.tmp
641 @echo ' { "pkgincludedir", "$(pkgincludedir)" }, \' \
e151bee6 642 >> libpath.tmp
28af5ee5 643 @echo ' { "extensionsdir", "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions" }, \' >> libpath.tmp
b6fae158 644 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
54f16aec
TTN
645 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
646 >> libpath.tmp
30dda257 647 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
5bbc5359 648 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
54f16aec 649 @echo ' { "buildstamp", "'"`date`"'" }, \' >> libpath.tmp
e151bee6
JB
650 @echo '}' >> libpath.tmp
651 @mv libpath.tmp libpath.h
733943b9 652
3dc81fba 653
47871d5a 654snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
e9c3d3f9 655
3dc81fba 656SUFFIXES = .x .doc
733943b9 657.c.x:
2c7a286a 658 ./guile-snarf -o $@ $< $(snarfcppopts)
c99f9605 659.c.doc:
23d72566 660 -$(AWK) -f ./guile-func-name-check $<
e9c3d3f9 661 (./guile-snarf-docs $(snarfcppopts) $< | \
af68e5e5 662 ./guile_filter_doc_snarfage$(EXEEXT) --filter-snarfage) > $@ || { rm $@; false; }
733943b9 663
23f2b9a3 664$(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in
c99f9605 665
23f2b9a3 666$(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
66418d34 667
faf6a29b
MV
668error.x: cpp_err_symbols.c
669posix.x: cpp_sig_symbols.c
670load.x: libpath.h
671
f8241358 672alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
e27f640a 673snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guile-tools snarf-check-and-output-texi
f8241358
TTN
674dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
675
2e945bcc 676guile.texi: $(alldotdocfiles) guile$(EXEEXT)
f8241358
TTN
677 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
678
2e945bcc 679guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
f8241358 680 $(dotdoc2texi) > $@ || { rm $@; false; }
9d29e990 681
9df3eecc
MV
682if HAVE_MAKEINFO
683
cecb4a5e 684guile-procedures.txt: guile-procedures.texi
9d29e990 685 rm -f $@
f7742034 686 makeinfo --force -o $@ guile-procedures.texi || test -f $@
4079f87e 687
9df3eecc
MV
688else
689
690guile-procedures.txt: guile-procedures.texi
f7742034 691 cp guile-procedures.texi $@
9df3eecc
MV
692
693endif
694
30e3be5a 695c-tokenize.c: c-tokenize.lex
47ac1e47 696 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
30e3be5a 697
d8a20ddb 698schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
8dc9439f 699schemelib_DATA = guile-procedures.txt
4079f87e 700
733943b9 701## Add -MG to make the .x magic work with auto-dep code.
47871d5a 702MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
ee78fbb0 703
a9c093e2 704cpp_err_symbols.c: cpp_err_symbols.in cpp_cnvt.awk
a0e90145 705 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \
593d151f
JB
706 cpp_err_symbols.tmp
707 mv cpp_err_symbols.tmp cpp_err_symbols.c
ee78fbb0 708
a9c093e2 709cpp_sig_symbols.c: cpp_sig_symbols.in cpp_cnvt.awk
a0e90145 710 $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_sig_symbols.in > \
593d151f
JB
711 cpp_sig_symbols.tmp
712 mv cpp_sig_symbols.tmp cpp_sig_symbols.c
67ec3667 713
a0e90145 714## Create a new version of the cpp_sig_symbols.in file, including all SIGXXX
67ec3667
GH
715## macros defined on this platform.
716check_signals:
5c146363 717 gcc -undef -dM -E $(srcdir)/cpp_signal.c | $(EGREP) ' SIG[A-Z]+' \
67ec3667 718 | cut -f2 -d' ' | sort > cpp_sig_symbols_here
a0e90145 719 diff -u $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_here \
5c146363 720 | $(EGREP) '^\+S' \
67ec3667
GH
721 | cut -c2- > cpp_sig_symbols_diff
722 if test -s cpp_sig_symbols_diff ; then \
a0e90145 723 cat $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_diff \
67ec3667
GH
724 | sort > cpp_sig_symbols_new ;\
725 echo "cpp_sig_symbols_new has the following additions:" ;\
726 cat cpp_sig_symbols_diff ;\
727 else echo "No new symbols found."; \
728 fi
729
a0e90145 730## Likewise for cpp_err_symbols.in.
67ec3667 731check_errnos:
5c146363 732 gcc -undef -dM -E $(srcdir)/cpp_errno.c | $(EGREP) ' E.+' \
67ec3667 733 | cut -f2 -d' ' | sort > cpp_err_symbols_here
a0e90145 734 diff -u $(srcdir)/cpp_err_symbols.in cpp_err_symbols_here \
5c146363 735 | $(EGREP) '^\+E' \
67ec3667
GH
736 | cut -c2- > cpp_err_symbols_diff
737 if test -s cpp_err_symbols_diff ; then \
a0e90145 738 cat $(srcdir)/cpp_err_symbols.in cpp_err_symbols_diff \
67ec3667
GH
739 | sort > cpp_err_symbols_new ;\
740 echo "cpp_err_symbols_new has the following additions:" ;\
741 cat cpp_err_symbols_diff ;\
742 else echo "No new symbols found."; \
743 fi
744
ad6b30a0
TP
745MOSTLYCLEANFILES = \
746 cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
d8a20ddb
RB
747 cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new \
748 version.h version.h.tmp \
23ccb831 749 scmconfig.h scmconfig.h.tmp
ad6b30a0 750
84595266
AW
751CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi \
752 vm-i-*.i
ee0c0e03
ML
753
754MAINTAINERCLEANFILES = c-tokenize.c