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