Merge remote-tracking branch 'local-2.0/stable-2.0'
[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 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 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 weak-set.c \
223 weak-table.c \
224 weak-vector.c
225
226 DOT_X_FILES = \
227 alist.x \
228 arbiters.x \
229 array-handle.x \
230 array-map.x \
231 arrays.x \
232 async.x \
233 backtrace.x \
234 boolean.x \
235 bitvectors.x \
236 bytevectors.x \
237 chars.x \
238 control.x \
239 continuations.x \
240 debug.x \
241 deprecated.x \
242 deprecation.x \
243 dynl.x \
244 dynwind.x \
245 eq.x \
246 error.x \
247 eval.x \
248 evalext.x \
249 expand.x \
250 extensions.x \
251 feature.x \
252 filesys.x \
253 fluids.x \
254 foreign.x \
255 fports.x \
256 gc-malloc.x \
257 gc.x \
258 gettext.x \
259 generalized-arrays.x \
260 generalized-vectors.x \
261 goops.x \
262 gsubr.x \
263 guardians.x \
264 hash.x \
265 hashtab.x \
266 hooks.x \
267 i18n.x \
268 init.x \
269 ioext.x \
270 keywords.x \
271 list.x \
272 load.x \
273 macros.x \
274 mallocs.x \
275 memoize.x \
276 modules.x \
277 numbers.x \
278 objprop.x \
279 options.x \
280 pairs.x \
281 ports.x \
282 print.x \
283 procprop.x \
284 procs.x \
285 promises.x \
286 r6rs-ports.x \
287 random.x \
288 rdelim.x \
289 read.x \
290 root.x \
291 rw.x \
292 scmsigs.x \
293 script.x \
294 simpos.x \
295 smob.x \
296 sort.x \
297 srcprop.x \
298 srfi-1.x \
299 srfi-4.x \
300 srfi-13.x \
301 srfi-14.x \
302 srfi-60.x \
303 stackchk.x \
304 stacks.x \
305 stime.x \
306 strings.x \
307 strorder.x \
308 strports.x \
309 struct.x \
310 symbols.x \
311 threads.x \
312 throw.x \
313 trees.x \
314 uniform.x \
315 values.x \
316 variable.x \
317 vectors.x \
318 version.x \
319 vports.x \
320 weak-set.x \
321 weak-table.x \
322 weak-vector.x
323
324 # vm-related snarfs
325 DOT_X_FILES += frames.x instructions.x objcodes.x programs.x vm.x
326
327 EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
328
329 DOT_DOC_FILES = \
330 alist.doc \
331 arbiters.doc \
332 array-handle.doc \
333 array-map.doc \
334 arrays.doc \
335 async.doc \
336 backtrace.doc \
337 boolean.doc \
338 bitvectors.doc \
339 bytevectors.doc \
340 chars.doc \
341 control.doc \
342 continuations.doc \
343 debug.doc \
344 deprecated.doc \
345 deprecation.doc \
346 dynl.doc \
347 dynwind.doc \
348 eq.doc \
349 error.doc \
350 eval.doc \
351 evalext.doc \
352 expand.doc \
353 extensions.doc \
354 feature.doc \
355 filesys.doc \
356 fluids.doc \
357 foreign.doc \
358 fports.doc \
359 gc-malloc.doc \
360 gc.doc \
361 gettext.doc \
362 generalized-arrays.doc \
363 generalized-vectors.doc \
364 goops.doc \
365 gsubr.doc \
366 guardians.doc \
367 hash.doc \
368 hashtab.doc \
369 hooks.doc \
370 i18n.doc \
371 init.doc \
372 ioext.doc \
373 keywords.doc \
374 list.doc \
375 load.doc \
376 macros.doc \
377 mallocs.doc \
378 memoize.doc \
379 modules.doc \
380 numbers.doc \
381 objprop.doc \
382 options.doc \
383 pairs.doc \
384 ports.doc \
385 print.doc \
386 procprop.doc \
387 procs.doc \
388 promises.doc \
389 r6rs-ports.doc \
390 random.doc \
391 rdelim.doc \
392 read.doc \
393 root.doc \
394 rw.doc \
395 scmsigs.doc \
396 script.doc \
397 simpos.doc \
398 smob.doc \
399 sort.doc \
400 srcprop.doc \
401 srfi-1.doc \
402 srfi-4.doc \
403 srfi-13.doc \
404 srfi-14.doc \
405 srfi-60.doc \
406 stackchk.doc \
407 stacks.doc \
408 stime.doc \
409 strings.doc \
410 strorder.doc \
411 strports.doc \
412 struct.doc \
413 symbols.doc \
414 threads.doc \
415 throw.doc \
416 trees.doc \
417 uniform.doc \
418 values.doc \
419 variable.doc \
420 vectors.doc \
421 version.doc \
422 vports.doc \
423 weak-set.doc \
424 weak-table.doc \
425 weak-vector.doc
426
427 EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
428
429 DOT_I_FILES = vm-i-system.i vm-i-scheme.i vm-i-loader.i
430
431 .c.i:
432 $(AM_V_GEN)$(GREP) '^VM_DEFINE' $< > $@
433
434 BUILT_SOURCES = cpp-E.c cpp-SIG.c libpath.h \
435 scmconfig.h \
436 $(DOT_I_FILES) $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
437
438 EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \
439 memmove.c strerror.c \
440 dynl.c regex-posix.c \
441 posix.c net_db.c socket.c \
442 debug-malloc.c mkstemp.c \
443 win32-uname.c win32-socket.c \
444 locale-categories.h
445
446 ## delete guile-snarf.awk from the installation bindir, in case it's
447 ## lingering there due to an earlier guile version not having been
448 ## wiped out.
449 install-exec-hook:
450 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
451
452 ## This is kind of nasty... there are ".c" files that we don't want to
453 ## compile, since they are #included. So instead we list them here.
454 ## Perhaps we can deal with them normally once the merge seems to be
455 ## working.
456 noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
457 ieee-754.h \
458 srfi-14.i.c \
459 quicksort.i.c \
460 win32-uname.h win32-socket.h \
461 private-gc.h private-options.h
462
463 # vm instructions
464 noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
465
466 libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES = @LIBLOBJS@
467
468 libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD = \
469 @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) $(LTLIBLTDL)
470
471 # Libtool version info.
472 version_info = @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@
473
474 libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS = \
475 $(BDW_GC_LIBS) $(LIBFFI_LIBS) \
476 $(CEIL_LIBM) \
477 $(FLOOR_LIBM) \
478 $(FREXP_LIBM) \
479 $(GETADDRINFO_LIB) \
480 $(HOSTENT_LIB) \
481 $(INET_NTOP_LIB) \
482 $(INET_PTON_LIB) \
483 $(ISNAND_LIBM) \
484 $(ISNANF_LIBM) \
485 $(ISNANL_LIBM) \
486 $(LDEXP_LIBM) \
487 $(LIB_CLOCK_GETTIME) \
488 $(LIBSOCKET) \
489 $(LOG1P_LIBM) \
490 $(LTLIBICONV) \
491 $(LTLIBINTL) \
492 $(LTLIBUNISTRING) \
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 weak-set.h \
629 weak-table.h \
630 weak-vector.h
631
632 nodist_modinclude_HEADERS = version.h scmconfig.h
633
634 bin_SCRIPTS = guile-snarf
635
636 # We can re-enable install for some of these if/when they are documented
637 # and people feel like maintaining them. For now, this is not the case.
638 noinst_SCRIPTS = guile-snarf-docs
639
640 EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
641 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 \
642 guile-func-name-check \
643 cpp-E.syms cpp-E.c cpp-SIG.syms cpp-SIG.c \
644 c-tokenize.lex \
645 scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map
646 # $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
647 # guile-procedures.txt guile.texi
648
649 ## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
650 libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
651 @rm -f libpath.tmp
652 @echo '/* generated by Makefile */' > libpath.tmp
653 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
654 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
655 @echo '#define SCM_SITE_DIR "$(sitedir)"' >> libpath.tmp
656 @echo '#define SCM_GLOBAL_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
657 @echo '#define SCM_LIB_DIR "$(libdir)"' >> libpath.tmp
658 @echo '#define SCM_EXTENSIONS_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions"' >> libpath.tmp
659 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
660 @echo '#define SCM_SITE_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache"' >> libpath.tmp
661 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
662 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
663 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
664 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
665 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
666 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
667 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
668 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
669 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
670 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
671 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
672 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
673 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
674 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
675 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
676 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
677 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
678 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
679 @echo ' { "pkgdatadir", "$(pkgdatadir)" }, \' >> libpath.tmp
680 @echo ' { "pkglibdir", "$(pkglibdir)" }, \' >> libpath.tmp
681 @echo ' { "pkgincludedir", "$(pkgincludedir)" }, \' \
682 >> libpath.tmp
683 @echo ' { "extensiondir", "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions" }, \' >> libpath.tmp
684 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
685 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
686 >> libpath.tmp
687 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
688 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
689 @echo ' { "buildstamp", "'`date -u +'%Y-%m-%d %T'`'" }, \' >> libpath.tmp
690 @echo '}' >> libpath.tmp
691 $(AM_V_GEN)mv libpath.tmp libpath.h
692
693
694 snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
695
696 SUFFIXES = .x .doc
697
698 .c.x:
699 $(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts)
700 .c.doc:
701 $(AM_V_SNARF)./guile-snarf-docs -o $@ $< -- $(snarfcppopts)
702
703 $(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in version.h
704
705 $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
706
707 error.x: cpp-E.c
708 posix.x: cpp-SIG.c
709 load.x: libpath.h
710
711 alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
712 snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(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 if HAVE_MAKEINFO
722
723 guile-procedures.txt: guile-procedures.texi
724 rm -f $@
725 makeinfo --force -o $@ guile-procedures.texi || test -f $@
726
727 else
728
729 guile-procedures.txt: guile-procedures.texi
730 cp guile-procedures.texi $@
731
732 endif
733
734 c-tokenize.c: c-tokenize.lex
735 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
736
737 schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
738 schemelib_DATA = guile-procedures.txt
739
740 ## Add -MG to make the .x magic work with auto-dep code.
741 MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
742
743 \f
744 # This page is for maintenance of the lists of CPP symbols that are eventually
745 # included in error.c (‘errno’ values: E*) and posix.c (signal names: SIG*),
746 # in the funcs scm_init_{error,posix}, respectively.
747 #
748 # The lists (files cpp-{E,SIG}.syms) are not included verbatim, but processed
749 # (via pattern rule ‘.syms.c’ below) so that each CPP symbol is transformed to
750 # fragment of #ifdef'd C code that defines a Scheme variable of the same name.
751 # The resulting files, cpp-{E,SIG}.c, are the ones #include:d.
752 #
753 # To maintain the (source) lists of symbols, we use a GCC-specific feature
754 # to list all symbols #define:d when expanding <{errno,signal}.h>, grep
755 # the output for {E,SIG}*, massage the result into a usable form, and
756 # construct a union of the current and new symbols. This is written to
757 # files cpp-{E,SIG}.syms.NEW for review. If things look ok, you can then
758 # "mv foo.NEW foo" and commit. Generating the foo.NEW files and showing
759 # an informative message is the job of targets chknew-{E,SIG}.
760
761 # For each line in foo.syms, transform:
762 # SYMBOL
763 # to:
764 # #ifdef SYMBOL
765 # scm_c_define ("SYMBOL", scm_from_int (SYMBOL));
766 # #endif
767 # writing output to foo.c. We use a while-read loop instead of a
768 # one-line sed script because some seds (e.g., FreeBSD) don't read
769 # '\n' as a newline (like GNU sed does). Sad, but true.
770 .syms.c:
771 $(AM_V_GEN) \
772 cat $< | while read sym ; do \
773 echo "#ifdef $$sym" ; \
774 echo "scm_c_define (\"$$sym\", scm_from_int ($$sym));" ; \
775 echo "#endif" ; \
776 done > $@T
777 @mv $@T $@
778
779 # Write $(srcdir)/cpp-{E,SIG}.syms.NEW if there are any not-yet-seen
780 # ("new" to us) E* or SIG* symbols in <errno.h> or <signal.h>, respectively.
781 chknew-E chknew-SIG: \
782 @bit=`echo $@ | sed s/^chknew-//` ; \
783 old="$(srcdir)/cpp-$$bit.syms" ; \
784 echo "#include <$${bit}.h>" \
785 | sed 's/E/errno/;s/SIG/signal/' \
786 | gcc -dM -E - \
787 | sed 's/^#define //;/^'$$bit'[A-Z][A-Z]*/!d;s/ .*//' \
788 | sort | diff -u $$old - | sed '1,2d;/^+/!d;s/^.//' \
789 > TMP ; \
790 if [ -s TMP ] ; then new="$$old.NEW" ; \
791 cat $$old TMP | sort > $$new ; \
792 echo "$$new: `sed -n '$$=' TMP` new symbol(s)." ; \
793 sed 's/^/ /' TMP ; \
794 else echo "No new symbols found." ; \
795 fi ; rm TMP
796
797 \f
798
799 MOSTLYCLEANFILES = \
800 scmconfig.h scmconfig.h.tmp
801
802 CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi \
803 vm-i-*.i
804
805 MAINTAINERCLEANFILES = c-tokenize.c