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