build: Adjust makefiles for `guile-procedures.txt'.
[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, 2012, 2013 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) -I$(top_builddir) -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 finalizers.c \
146 fluids.c \
147 foreign.c \
148 fports.c \
149 frames.c \
150 gc-malloc.c \
151 gc.c \
152 gdbint.c \
153 gettext.c \
154 generalized-arrays.c \
155 generalized-vectors.c \
156 goops.c \
157 gsubr.c \
158 guardians.c \
159 hash.c \
160 hashtab.c \
161 hooks.c \
162 i18n.c \
163 init.c \
164 inline.c \
165 instructions.c \
166 ioext.c \
167 keywords.c \
168 list.c \
169 load.c \
170 macros.c \
171 mallocs.c \
172 memoize.c \
173 modules.c \
174 null-threads.c \
175 numbers.c \
176 objcodes.c \
177 objprop.c \
178 options.c \
179 pairs.c \
180 poll.c \
181 ports.c \
182 print.c \
183 procprop.c \
184 procs.c \
185 programs.c \
186 promises.c \
187 r6rs-ports.c \
188 random.c \
189 rdelim.c \
190 read.c \
191 root.c \
192 rw.c \
193 scmsigs.c \
194 script.c \
195 simpos.c \
196 smob.c \
197 sort.c \
198 srcprop.c \
199 srfi-1.c \
200 srfi-4.c \
201 srfi-13.c \
202 srfi-14.c \
203 srfi-60.c \
204 stackchk.c \
205 stacks.c \
206 stime.c \
207 strings.c \
208 strorder.c \
209 strports.c \
210 struct.c \
211 symbols.c \
212 threads.c \
213 throw.c \
214 trees.c \
215 uniform.c \
216 values.c \
217 variable.c \
218 vectors.c \
219 version.c \
220 vm.c \
221 vports.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 weaks.x
319
320 # vm-related snarfs
321 DOT_X_FILES += frames.x instructions.x objcodes.x programs.x vm.x
322
323 EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
324
325 DOT_DOC_FILES = \
326 alist.doc \
327 arbiters.doc \
328 array-handle.doc \
329 array-map.doc \
330 arrays.doc \
331 async.doc \
332 backtrace.doc \
333 boolean.doc \
334 bitvectors.doc \
335 bytevectors.doc \
336 chars.doc \
337 control.doc \
338 continuations.doc \
339 debug.doc \
340 deprecated.doc \
341 deprecation.doc \
342 dynl.doc \
343 dynwind.doc \
344 eq.doc \
345 error.doc \
346 eval.doc \
347 evalext.doc \
348 expand.doc \
349 extensions.doc \
350 feature.doc \
351 filesys.doc \
352 fluids.doc \
353 foreign.doc \
354 fports.doc \
355 gc-malloc.doc \
356 gc.doc \
357 gettext.doc \
358 generalized-arrays.doc \
359 generalized-vectors.doc \
360 goops.doc \
361 gsubr.doc \
362 guardians.doc \
363 hash.doc \
364 hashtab.doc \
365 hooks.doc \
366 i18n.doc \
367 init.doc \
368 ioext.doc \
369 keywords.doc \
370 list.doc \
371 load.doc \
372 macros.doc \
373 mallocs.doc \
374 memoize.doc \
375 modules.doc \
376 numbers.doc \
377 objprop.doc \
378 options.doc \
379 pairs.doc \
380 ports.doc \
381 print.doc \
382 procprop.doc \
383 procs.doc \
384 promises.doc \
385 r6rs-ports.doc \
386 random.doc \
387 rdelim.doc \
388 read.doc \
389 root.doc \
390 rw.doc \
391 scmsigs.doc \
392 script.doc \
393 simpos.doc \
394 smob.doc \
395 sort.doc \
396 srcprop.doc \
397 srfi-1.doc \
398 srfi-4.doc \
399 srfi-13.doc \
400 srfi-14.doc \
401 srfi-60.doc \
402 stackchk.doc \
403 stacks.doc \
404 stime.doc \
405 strings.doc \
406 strorder.doc \
407 strports.doc \
408 struct.doc \
409 symbols.doc \
410 threads.doc \
411 throw.doc \
412 trees.doc \
413 uniform.doc \
414 values.doc \
415 variable.doc \
416 vectors.doc \
417 version.doc \
418 vports.doc \
419 weaks.doc
420
421 EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
422
423 DOT_I_FILES = vm-i-system.i vm-i-scheme.i vm-i-loader.i
424
425 .c.i:
426 $(AM_V_GEN)$(GREP) '^VM_DEFINE' $< > $@
427
428 BUILT_SOURCES = cpp-E.c cpp-SIG.c libpath.h \
429 scmconfig.h \
430 $(DOT_I_FILES) $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
431
432 # Force the generation of `guile-procedures.texi' because the top-level
433 # Makefile expects it to be built.
434 all-local: guile-procedures.texi
435
436 EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \
437 memmove.c strerror.c \
438 dynl.c regex-posix.c \
439 posix.c net_db.c socket.c \
440 debug-malloc.c mkstemp.c \
441 win32-uname.c \
442 locale-categories.h
443
444 ## delete guile-snarf.awk from the installation bindir, in case it's
445 ## lingering there due to an earlier guile version not having been
446 ## wiped out.
447 install-exec-hook:
448 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
449
450 ## This is kind of nasty... there are ".c" files that we don't want to
451 ## compile, since they are #included. So instead we list them here.
452 ## Perhaps we can deal with them normally once the merge seems to be
453 ## working.
454 noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
455 srfi-14.i.c \
456 quicksort.i.c \
457 win32-uname.h \
458 private-gc.h private-options.h
459
460 # vm instructions
461 noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
462
463 libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES = @LIBLOBJS@
464
465 libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD = \
466 @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) $(LTLIBLTDL)
467
468 # Libtool version info.
469 version_info = @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@
470
471 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS = \
472 $(BDW_GC_LIBS) $(LIBFFI_LIBS) \
473 $(CEIL_LIBM) \
474 $(FLOOR_LIBM) \
475 $(FREXP_LIBM) \
476 $(GETADDRINFO_LIB) \
477 $(HOSTENT_LIB) \
478 $(INET_NTOP_LIB) \
479 $(INET_PTON_LIB) \
480 $(ISNAND_LIBM) \
481 $(ISNANF_LIBM) \
482 $(ISNANL_LIBM) \
483 $(LDEXP_LIBM) \
484 $(LIBSOCKET) \
485 $(LIB_CLOCK_GETTIME) \
486 $(LOG1P_LIBM) \
487 $(LOG_LIBM) \
488 $(LTLIBICONV) \
489 $(LTLIBINTL) \
490 $(LTLIBUNISTRING) \
491 $(ROUND_LIBM) \
492 $(SERVENT_LIB) \
493 $(TRUNC_LIBM) \
494 -version-info $(version_info) \
495 -export-dynamic -no-undefined \
496 $(GNU_LD_FLAGS)
497
498 if HAVE_LD_VERSION_SCRIPT
499
500 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS += -Wl,--version-script="$(srcdir)/libguile.map"
501
502 endif HAVE_LD_VERSION_SCRIPT
503
504
505 # These are headers visible as <guile/mumble.h>
506 pkginclude_HEADERS =
507
508 # These are headers visible as <libguile/mumble.h>.
509 modincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)/libguile
510 modinclude_HEADERS = \
511 __scm.h \
512 alist.h \
513 arbiters.h \
514 array-handle.h \
515 array-map.h \
516 arrays.h \
517 async.h \
518 backtrace.h \
519 bdw-gc.h \
520 boolean.h \
521 bitvectors.h \
522 bytevectors.h \
523 chars.h \
524 control.h \
525 continuations.h \
526 debug-malloc.h \
527 debug.h \
528 deprecated.h \
529 deprecation.h \
530 dynl.h \
531 dynwind.h \
532 eq.h \
533 error.h \
534 eval.h \
535 evalext.h \
536 expand.h \
537 extensions.h \
538 feature.h \
539 finalizers.h \
540 filesys.h \
541 fluids.h \
542 foreign.h \
543 fports.h \
544 frames.h \
545 gc.h \
546 gdb_interface.h \
547 gdbint.h \
548 gettext.h \
549 generalized-arrays.h \
550 generalized-vectors.h \
551 goops.h \
552 gsubr.h \
553 guardians.h \
554 hash.h \
555 hashtab.h \
556 hooks.h \
557 i18n.h \
558 init.h \
559 inline.h \
560 instructions.h \
561 ioext.h \
562 iselect.h \
563 keywords.h \
564 list.h \
565 load.h \
566 macros.h \
567 mallocs.h \
568 memoize.h \
569 modules.h \
570 net_db.h \
571 null-threads.h \
572 numbers.h \
573 objcodes.h \
574 objprop.h \
575 options.h \
576 pairs.h \
577 poll.h \
578 ports.h \
579 posix.h \
580 print.h \
581 procprop.h \
582 procs.h \
583 programs.h \
584 promises.h \
585 pthread-threads.h \
586 r6rs-ports.h \
587 random.h \
588 rdelim.h \
589 read.h \
590 regex-posix.h \
591 root.h \
592 rw.h \
593 scmsigs.h \
594 script.h \
595 simpos.h \
596 smob.h \
597 snarf.h \
598 socket.h \
599 sort.h \
600 srcprop.h \
601 srfi-1.h \
602 srfi-4.h \
603 srfi-13.h \
604 srfi-14.h \
605 srfi-60.h \
606 stackchk.h \
607 stacks.h \
608 stime.h \
609 strings.h \
610 strorder.h \
611 strports.h \
612 struct.h \
613 symbols.h \
614 tags.h \
615 threads.h \
616 throw.h \
617 trees.h \
618 validate.h \
619 uniform.h \
620 values.h \
621 variable.h \
622 vectors.h \
623 vm-engine.h \
624 vm-expand.h \
625 vm.h \
626 vports.h \
627 weaks.h
628
629 nodist_modinclude_HEADERS = version.h scmconfig.h
630
631 bin_SCRIPTS = guile-snarf
632
633 # We can re-enable install for some of these if/when they are documented
634 # and people feel like maintaining them. For now, this is not the case.
635 noinst_SCRIPTS = guile-snarf-docs
636
637 EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
638 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 \
639 guile-func-name-check \
640 cpp-E.syms cpp-E.c cpp-SIG.syms cpp-SIG.c \
641 c-tokenize.lex \
642 scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map
643 # $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
644 # guile-procedures.txt guile.texi
645
646 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
647 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
648 @rm -f libpath.tmp
649 @echo '/* generated by Makefile */' > libpath.tmp
650 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
651 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
652 @echo '#define SCM_SITE_DIR "$(sitedir)"' >> libpath.tmp
653 @echo '#define SCM_GLOBAL_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
654 @echo '#define SCM_LIB_DIR "$(libdir)"' >> libpath.tmp
655 @echo '#define SCM_EXTENSIONS_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions"' >> libpath.tmp
656 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
657 @echo '#define SCM_SITE_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache"' >> libpath.tmp
658 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
659 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
660 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
661 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
662 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
663 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
664 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
665 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
666 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
667 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
668 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
669 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
670 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
671 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
672 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
673 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
674 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
675 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
676 @echo ' { "pkgdatadir", "$(pkgdatadir)" }, \' >> libpath.tmp
677 @echo ' { "pkglibdir", "$(pkglibdir)" }, \' >> libpath.tmp
678 @echo ' { "pkgincludedir", "$(pkgincludedir)" }, \' \
679 >> libpath.tmp
680 @echo ' { "extensiondir", "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions" }, \' >> libpath.tmp
681 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
682 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
683 >> libpath.tmp
684 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
685 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
686 @echo ' { "buildstamp", "'`date -u +'%Y-%m-%d %T'`'" }, \' >> libpath.tmp
687 @echo '}' >> libpath.tmp
688 $(AM_V_GEN)mv libpath.tmp libpath.h
689
690
691 snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
692
693 SUFFIXES = .x .doc
694
695 .c.x:
696 $(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts)
697 .c.doc:
698 $(AM_V_SNARF)./guile-snarf-docs -o $@ $< -- $(snarfcppopts)
699
700 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in version.h
701
702 $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
703
704 error.x: cpp-E.c
705 posix.x: cpp-SIG.c
706 load.x: libpath.h
707 dynl.x: libpath.h
708
709 alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
710 snarf2checkedtexi = GUILE_INSTALL_LOCALE=1 GUILE_AUTO_COMPILE=0 \
711 $(top_builddir)/meta/uninstalled-env guild snarf-check-and-output-texi
712 dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
713
714 guile.texi: $(alldotdocfiles) guile$(EXEEXT)
715 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
716
717 guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
718 $(AM_V_GEN)$(dotdoc2texi) > $@ || { rm $@; false; }
719
720 c-tokenize.c: c-tokenize.lex
721 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
722
723 ## Add -MG to make the .x magic work with auto-dep code.
724 MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
725
726 \f
727 # This page is for maintenance of the lists of CPP symbols that are eventually
728 # included in error.c (‘errno’ values: E*) and posix.c (signal names: SIG*),
729 # in the funcs scm_init_{error,posix}, respectively.
730 #
731 # The lists (files cpp-{E,SIG}.syms) are not included verbatim, but processed
732 # (via pattern rule ‘.syms.c’ below) so that each CPP symbol is transformed to
733 # fragment of #ifdef'd C code that defines a Scheme variable of the same name.
734 # The resulting files, cpp-{E,SIG}.c, are the ones #include:d.
735 #
736 # To maintain the (source) lists of symbols, we use a GCC-specific feature
737 # to list all symbols #define:d when expanding <{errno,signal}.h>, grep
738 # the output for {E,SIG}*, massage the result into a usable form, and
739 # construct a union of the current and new symbols. This is written to
740 # files cpp-{E,SIG}.syms.NEW for review. If things look ok, you can then
741 # "mv foo.NEW foo" and commit. Generating the foo.NEW files and showing
742 # an informative message is the job of targets chknew-{E,SIG}.
743
744 # For each line in foo.syms, transform:
745 # SYMBOL
746 # to:
747 # #ifdef SYMBOL
748 # scm_c_define ("SYMBOL", scm_from_int (SYMBOL));
749 # #endif
750 # writing output to foo.c. We use a while-read loop instead of a
751 # one-line sed script because some seds (e.g., FreeBSD) don't read
752 # '\n' as a newline (like GNU sed does). Sad, but true.
753 .syms.c:
754 $(AM_V_GEN) \
755 cat $< | while read sym ; do \
756 echo "#ifdef $$sym" ; \
757 echo "scm_c_define (\"$$sym\", scm_from_int ($$sym));" ; \
758 echo "#endif" ; \
759 done > $@T
760 @mv $@T $@
761
762 # Write $(srcdir)/cpp-{E,SIG}.syms.NEW if there are any not-yet-seen
763 # ("new" to us) E* or SIG* symbols in <errno.h> or <signal.h>, respectively.
764 chknew-E chknew-SIG: \
765 @bit=`echo $@ | sed s/^chknew-//` ; \
766 old="$(srcdir)/cpp-$$bit.syms" ; \
767 echo "#include <$${bit}.h>" \
768 | sed 's/E/errno/;s/SIG/signal/' \
769 | gcc -dM -E - \
770 | sed 's/^#define //;/^'$$bit'[A-Z][A-Z]*/!d;s/ .*//' \
771 | sort | diff -u $$old - | sed '1,2d;/^+/!d;s/^.//' \
772 > TMP ; \
773 if [ -s TMP ] ; then new="$$old.NEW" ; \
774 cat $$old TMP | sort > $$new ; \
775 echo "$$new: `sed -n '$$=' TMP` new symbol(s)." ; \
776 sed 's/^/ /' TMP ; \
777 else echo "No new symbols found." ; \
778 fi ; rm TMP
779
780 \f
781
782 MOSTLYCLEANFILES = \
783 scmconfig.h scmconfig.h.tmp
784
785 CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi \
786 vm-i-*.i
787
788 MAINTAINERCLEANFILES = c-tokenize.c