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