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