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