Update AUTHORS to reflect now-removed guile-snarf-docs-texi; nfc.
[bpt/guile.git] / libguile / Makefile.am
CommitLineData
733943b9 1## Process this file with Automake to create Makefile.in
2764bd99 2##
e2c2a699 3## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
2764bd99
JB
4##
5## This file is part of GUILE.
54f16aec 6##
53befeb7
NJ
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
2764bd99 10## (at your option) any later version.
54f16aec 11##
2764bd99
JB
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
53befeb7 15## GNU Lesser General Public License for more details.
54f16aec 16##
53befeb7
NJ
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
733943b9 21
a572fc95
NI
22include $(top_srcdir)/am/snarf
23
3307df95 24AUTOMAKE_OPTIONS = gnu
733943b9 25
a0599745 26## Prevent automake from adding extra -I options
8f99e3f3 27DEFS = @DEFS@
535b3592
LC
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>.
32DEFAULT_INCLUDES =
33
733943b9
TT
34## Check for headers in $(srcdir)/.., so that #include
35## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
6caac03c 36## building. Also look for Gnulib headers in `lib'.
442f3f20 37AM_CPPFLAGS = -DBUILDING_LIBGUILE=1 -I$(top_srcdir) -I$(top_builddir) \
d8b04f04 38 -I$(top_srcdir)/lib -I$(top_builddir)/lib $(LIBFFI_CFLAGS)
6caac03c 39
d8b04f04 40AM_CFLAGS = $(GCC_CFLAGS) $(CFLAG_VISIBILITY)
6caac03c
LC
41
42## The Gnulib Libtool archive.
43gnulib_library = $(top_builddir)/lib/libgnu.la
733943b9 44
4079f87e 45ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
abc049a9 46 --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
fef07353 47
44602b08 48lib_LTLIBRARIES = libguile-@GUILE_EFFECTIVE_VERSION@.la
f94b6524 49bin_PROGRAMS = guile
b32fca0f 50
64c2db80
RB
51noinst_PROGRAMS = guile_filter_doc_snarfage gen-scmconfig
52
53gen_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
57gen-scmconfig.$(OBJEXT): gen-scmconfig.c
a572fc95 58 $(AM_V_GEN) \
64c2db80 59 if [ "$(cross_compiling)" = "yes" ]; then \
47871d5a 60 $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) -c -o $@ $<; \
64c2db80
RB
61 else \
62 $(COMPILE) -c -o $@ $<; \
63 fi
64
2e945bcc 65## Override default rule; this should run on BUILD host.
6a6df187 66gen-scmconfig$(EXEEXT): $(gen_scmconfig_OBJECTS) $(gen_scmconfig_DEPENDENCIES)
a572fc95
NI
67 $(AM_V_GEN) \
68 rm -f gen-scmconfig$(EXEEXT); \
2e945bcc
SJ
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
75scmconfig.h: ${top_builddir}/config.h gen-scmconfig$(EXEEXT)
a572fc95
NI
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
64c2db80 83
b32fca0f
MV
84guile_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
88c-tokenize.$(OBJEXT): c-tokenize.c
a572fc95 89 $(AM_V_GEN) \
b32fca0f 90 if [ "$(cross_compiling)" = "yes" ]; then \
47871d5a 91 $(CC_FOR_BUILD) $(DEFS) $(AM_CPPFLAGS) -c -o $@ $<; \
b32fca0f 92 else \
4ea57d5b 93 $(COMPILE) -c -o $@ $<; \
b32fca0f
MV
94 fi
95
96## Override default rule; this should run on BUILD host.
6a6df187 97guile_filter_doc_snarfage$(EXEEXT): $(guile_filter_doc_snarfage_OBJECTS) $(guile_filter_doc_snarfage_DEPENDENCIES)
a572fc95
NI
98 $(AM_V_GEN) \
99 rm -f guile_filter_doc_snarfage$(EXEEXT); \
b32fca0f
MV
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
549436de
JB
106
107guile_SOURCES = guile.c
bfb2e113 108guile_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
44602b08 109guile_LDADD = libguile-@GUILE_EFFECTIVE_VERSION@.la
de7d32d0 110guile_LDFLAGS = $(GUILE_CFLAGS)
5bbc5359 111
44602b08 112libguile_@GUILE_EFFECTIVE_VERSION@_la_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
ee2a8b9b 113
44602b08 114libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = \
a4a0d399
AW
115 alist.c \
116 arbiters.c \
c53c0893 117 array-handle.c \
5d1b3b2d 118 array-map.c \
2fa901a5 119 arrays.c \
a4a0d399
AW
120 async.c \
121 backtrace.c \
122 boolean.c \
cf396142 123 bitvectors.c \
a4a0d399
AW
124 bytevectors.c \
125 chars.c \
b9c100d0 126 control.c \
a4a0d399
AW
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 \
dc3e203e 137 expand.c \
a4a0d399
AW
138 extensions.c \
139 feature.c \
140 fluids.c \
e2c2a699 141 foreign.c \
a4a0d399
AW
142 fports.c \
143 frames.c \
a4a0d399 144 gc-malloc.c \
a4a0d399 145 gc.c \
a4a0d399
AW
146 gdbint.c \
147 gettext.c \
1030b450 148 generalized-arrays.c \
f332e957 149 generalized-vectors.c \
a4a0d399
AW
150 goops.c \
151 gsubr.c \
152 guardians.c \
153 hash.c \
154 hashtab.c \
155 hooks.c \
756e8a3a 156 i18n.c \
a4a0d399
AW
157 init.c \
158 inline.c \
159 instructions.c \
160 ioext.c \
161 keywords.c \
a4a0d399
AW
162 list.c \
163 load.c \
164 macros.c \
165 mallocs.c \
b7742c6b 166 memoize.c \
a4a0d399
AW
167 modules.c \
168 null-threads.c \
169 numbers.c \
170 objcodes.c \
a4a0d399
AW
171 objprop.c \
172 options.c \
173 pairs.c \
174 ports.c \
175 print.c \
176 procprop.c \
177 procs.c \
178 programs.c \
7b893819 179 promises.c \
a4a0d399
AW
180 properties.c \
181 r6rs-ports.c \
a4a0d399
AW
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 \
0f458a37 206 trees.c \
476b894c 207 uniform.c \
a4a0d399
AW
208 values.c \
209 variable.c \
210 vectors.c \
211 version.c \
212 vm.c \
213 vports.c \
214 weaks.c
83495480 215
a4a0d399
AW
216DOT_X_FILES = \
217 alist.x \
218 arbiters.x \
c53c0893 219 array-handle.x \
5d1b3b2d 220 array-map.x \
2fa901a5 221 arrays.x \
a4a0d399
AW
222 async.x \
223 backtrace.x \
224 boolean.x \
cf396142 225 bitvectors.x \
a4a0d399
AW
226 bytevectors.x \
227 chars.x \
b9c100d0 228 control.x \
a4a0d399
AW
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 \
dc3e203e 240 expand.x \
a4a0d399
AW
241 extensions.x \
242 feature.x \
243 fluids.x \
e2c2a699 244 foreign.x \
a4a0d399 245 fports.x \
a4a0d399 246 gc-malloc.x \
a4a0d399
AW
247 gc.x \
248 gettext.x \
1030b450 249 generalized-arrays.x \
f332e957 250 generalized-vectors.x \
a4a0d399
AW
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 \
a4a0d399
AW
261 list.x \
262 load.x \
263 macros.x \
264 mallocs.x \
b7742c6b 265 memoize.x \
a4a0d399
AW
266 modules.x \
267 numbers.x \
a4a0d399
AW
268 objprop.x \
269 options.x \
270 pairs.x \
271 ports.x \
272 print.x \
273 procprop.x \
274 procs.x \
7b893819 275 promises.x \
a4a0d399
AW
276 properties.x \
277 r6rs-ports.x \
a4a0d399
AW
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 \
0f458a37 302 trees.x \
476b894c 303 uniform.x \
a4a0d399
AW
304 values.x \
305 variable.x \
306 vectors.x \
307 version.x \
308 vports.x \
309 weaks.x
8bee78b3 310
83495480
AW
311# vm-related snarfs
312DOT_X_FILES += frames.x instructions.x objcodes.x programs.x vm.x
313
e9e225e5 314EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
8bee78b3 315
a4a0d399
AW
316DOT_DOC_FILES = \
317 alist.doc \
318 arbiters.doc \
c53c0893 319 array-handle.doc \
5d1b3b2d 320 array-map.doc \
2fa901a5 321 arrays.doc \
a4a0d399
AW
322 async.doc \
323 backtrace.doc \
324 boolean.doc \
cf396142 325 bitvectors.doc \
a4a0d399
AW
326 bytevectors.doc \
327 chars.doc \
b9c100d0 328 control.doc \
a4a0d399
AW
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 \
dc3e203e 340 expand.doc \
a4a0d399
AW
341 extensions.doc \
342 feature.doc \
343 fluids.doc \
e2c2a699 344 foreign.doc \
a4a0d399 345 fports.doc \
a4a0d399 346 gc-malloc.doc \
a4a0d399
AW
347 gc.doc \
348 gettext.doc \
1030b450 349 generalized-arrays.doc \
476b894c 350 generalized-vectors.doc \
a4a0d399
AW
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 \
a4a0d399
AW
361 list.doc \
362 load.doc \
363 macros.doc \
364 mallocs.doc \
b7742c6b 365 memoize.doc \
a4a0d399
AW
366 modules.doc \
367 numbers.doc \
a4a0d399
AW
368 objprop.doc \
369 options.doc \
370 pairs.doc \
371 ports.doc \
372 print.doc \
373 procprop.doc \
374 procs.doc \
7b893819 375 promises.doc \
a4a0d399
AW
376 properties.doc \
377 r6rs-ports.doc \
a4a0d399
AW
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 \
0f458a37 402 trees.doc \
476b894c 403 uniform.doc \
a4a0d399
AW
404 values.doc \
405 variable.doc \
406 vectors.doc \
407 version.doc \
408 vports.doc \
409 weaks.doc
a3365d47 410
2ce88b54 411EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
9515eae6 412
83495480
AW
413DOT_I_FILES = vm-i-system.i vm-i-scheme.i vm-i-loader.i
414
415.c.i:
a572fc95 416 $(AM_V_GEN)$(GREP) '^VM_DEFINE' $< > $@
83495480 417
648da032 418BUILT_SOURCES = cpp-E.c cpp-SIG.c libpath.h \
64c2db80 419 version.h scmconfig.h \
83495480 420 $(DOT_I_FILES) $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
9515eae6 421
44602b08 422EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \
c32b39b9 423 memmove.c strerror.c \
f731051e
MV
424 dynl.c regex-posix.c \
425 filesys.c posix.c net_db.c socket.c \
29627818 426 debug-malloc.c mkstemp.c \
b89c4943
LC
427 win32-uname.c win32-dirent.c win32-socket.c \
428 locale-categories.h
7bfd3b9e 429
413a1367
ML
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.
433install-exec-hook:
b27b814d 434 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
413a1367 435
7bfd3b9e 436## This is kind of nasty... there are ".c" files that we don't want to
1be6b49c
ML
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.
4b126598 440noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
71560395 441 ieee-754.h \
71560395 442 srfi-14.i.c \
06f9c814 443 quicksort.i.c \
340c49bf 444 win32-uname.h win32-dirent.h win32-socket.h \
981ff600 445 private-gc.h private-options.h
7bfd3b9e 446
83495480
AW
447# vm instructions
448noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
449
44602b08
AW
450libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES = @LIBLOBJS@
451libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD = \
f29ded4b 452 @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) \
2bfa4d5c 453 $(LTLIBUNISTRING) $(LTLIBICONV) $(LTLIBINTL)
44602b08 454libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS = \
61cd9dc9
LC
455 @LTLIBINTL@ $(LIBFFI_LIBS) $(INET_NTOP_LIB) $(INET_PTON_LIB) \
456 $(GETADDRINFO_LIB) $(HOSTENT_LIB) $(SERVENT_LIB) \
76e8a758 457 -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ \
61cd9dc9 458 -export-dynamic -no-undefined \
76e8a758 459 $(GNU_LD_FLAGS)
733943b9 460
9af080f7
LC
461if HAVE_LD_VERSION_SCRIPT
462
44602b08 463libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS += -Wl,--version-script="$(srcdir)/libguile.map"
9af080f7
LC
464
465endif HAVE_LD_VERSION_SCRIPT
466
467
54f16aec 468# These are headers visible as <guile/mumble.h>
6a6df187 469pkginclude_HEADERS =
ee2a8b9b 470
733943b9 471# These are headers visible as <libguile/mumble.h>.
718815d7 472modincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)/libguile
a4a0d399
AW
473modinclude_HEADERS = \
474 __scm.h \
475 alist.h \
476 arbiters.h \
c53c0893 477 array-handle.h \
5d1b3b2d 478 array-map.h \
2fa901a5 479 arrays.h \
a4a0d399
AW
480 async.h \
481 backtrace.h \
1c44468d 482 bdw-gc.h \
a4a0d399 483 boolean.h \
cf396142 484 bitvectors.h \
a4a0d399
AW
485 bytevectors.h \
486 chars.h \
b9c100d0 487 control.h \
a4a0d399
AW
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 \
dc3e203e 500 expand.h \
a4a0d399
AW
501 extensions.h \
502 feature.h \
503 filesys.h \
504 fluids.h \
e2c2a699 505 foreign.h \
a4a0d399
AW
506 fports.h \
507 frames.h \
a4a0d399
AW
508 gc.h \
509 gdb_interface.h \
510 gdbint.h \
511 gettext.h \
1030b450 512 generalized-arrays.h \
f332e957 513 generalized-vectors.h \
a4a0d399
AW
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 \
a4a0d399
AW
527 list.h \
528 load.h \
529 macros.h \
530 mallocs.h \
b7742c6b 531 memoize.h \
a4a0d399
AW
532 modules.h \
533 net_db.h \
534 null-threads.h \
535 numbers.h \
536 objcodes.h \
a4a0d399
AW
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 \
7b893819 546 promises.h \
a4a0d399
AW
547 properties.h \
548 pthread-threads.h \
549 r6rs-ports.h \
a4a0d399
AW
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 \
0f458a37 578 trees.h \
a4a0d399 579 validate.h \
476b894c 580 uniform.h \
a4a0d399
AW
581 values.h \
582 variable.h \
583 vectors.h \
a4a0d399
AW
584 vm-engine.h \
585 vm-expand.h \
586 vm.h \
587 vports.h \
588 weaks.h
83495480 589
93ff93f6 590nodist_modinclude_HEADERS = version.h scmconfig.h
733943b9 591
604a672e
TTN
592bin_SCRIPTS = guile-snarf
593
f94b6524
TTN
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.
395afce9 596noinst_SCRIPTS = guile-snarf-docs guile-func-name-check
adb75a41 597
89bc270d 598EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
648da032
TTN
599 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 \
600 cpp-E.syms cpp-E.c cpp-SIG.syms cpp-SIG.c \
61db429e 601 c-tokenize.lex version.h.in \
f49dbcad 602 scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map
c99f9605
ML
603# $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
604# guile-procedures.txt guile.texi
733943b9 605
d8a20ddb
RB
606## We use @-...-@ as the substitution brackets here, instead of the
607## usual @...@, so autoconf doesn't go and substitute the values
608## directly into the left-hand sides of the sed substitutions. *sigh*
c66fe8a9 609version.h: version.h.in $(top_builddir)/config.status
a572fc95 610 $(AM_V_GEN)sed < $(srcdir)/version.h.in > $@.tmp \
d8a20ddb
RB
611 -e s:@-GUILE_MAJOR_VERSION-@:${GUILE_MAJOR_VERSION}: \
612 -e s:@-GUILE_MINOR_VERSION-@:${GUILE_MINOR_VERSION}: \
89607fab 613 -e s:@-GUILE_MICRO_VERSION-@:${GUILE_MICRO_VERSION}: \
a572fc95 614 -e s:@-GUILE_EFFECTIVE_VERSION-@:${GUILE_EFFECTIVE_VERSION}: && mv $@.tmp $@
d8a20ddb 615
fef07353 616## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
90ff3ec5 617libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
e151bee6
JB
618 @rm -f libpath.tmp
619 @echo '/* generated by Makefile */' > libpath.tmp
620 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
d8a20ddb 621 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
e151bee6 622 @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
28af5ee5
AW
623 @echo '#define SCM_LIB_DIR "$(libdir)"' >> libpath.tmp
624 @echo '#define SCM_EXTENSIONS_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions"' >> libpath.tmp
5b197db8
AW
625 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
626 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
e151bee6
JB
627 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
628 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
c565712c 629 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
e151bee6
JB
630 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
631 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
632 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
633 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
634 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
635 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
636 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
637 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
638 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
639 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
5b197db8 640 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
e151bee6
JB
641 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
642 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
643 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
eb350124
AW
644 @echo ' { "pkgdatadir", "$(pkgdatadir)" }, \' >> libpath.tmp
645 @echo ' { "pkglibdir", "$(pkglibdir)" }, \' >> libpath.tmp
646 @echo ' { "pkgincludedir", "$(pkgincludedir)" }, \' \
e151bee6 647 >> libpath.tmp
28af5ee5 648 @echo ' { "extensionsdir", "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions" }, \' >> libpath.tmp
b6fae158 649 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
54f16aec
TTN
650 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
651 >> libpath.tmp
30dda257 652 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
5bbc5359 653 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
a6025413 654 @echo ' { "buildstamp", "'`date -u +'%Y-%m-%d %T'`'" }, \' >> libpath.tmp
e151bee6 655 @echo '}' >> libpath.tmp
a572fc95 656 $(AM_V_GEN)mv libpath.tmp libpath.h
733943b9 657
3dc81fba 658
47871d5a 659snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
e9c3d3f9 660
3dc81fba 661SUFFIXES = .x .doc
a572fc95
NI
662
663AM_V_FILTER = $(AM_V_FILTER_$(V))
664AM_V_FILTER_ = $(AM_V_FILTER_$(AM_DEFAULT_VERBOSITY))
665AM_V_FILTER_0 = @echo " FILTER" $@;
666
733943b9 667.c.x:
a572fc95 668 $(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts)
c99f9605 669.c.doc:
6a6df187 670 -$(AM_V_FILTER)$(AWK) -f $(srcdir)/guile-func-name-check $< && (./guile-snarf-docs $(snarfcppopts) $< | ./guile_filter_doc_snarfage$(EXEEXT) --filter-snarfage) > $@ || { rm $@; false; }
733943b9 671
23f2b9a3 672$(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in
c99f9605 673
23f2b9a3 674$(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
66418d34 675
648da032
TTN
676error.x: cpp-E.c
677posix.x: cpp-SIG.c
faf6a29b
MV
678load.x: libpath.h
679
f8241358 680alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
e27f640a 681snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guile-tools snarf-check-and-output-texi
f8241358
TTN
682dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
683
2e945bcc 684guile.texi: $(alldotdocfiles) guile$(EXEEXT)
f8241358
TTN
685 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
686
2e945bcc 687guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
a572fc95 688 $(AM_V_GEN)$(dotdoc2texi) > $@ || { rm $@; false; }
9d29e990 689
9df3eecc
MV
690if HAVE_MAKEINFO
691
cecb4a5e 692guile-procedures.txt: guile-procedures.texi
9d29e990 693 rm -f $@
f7742034 694 makeinfo --force -o $@ guile-procedures.texi || test -f $@
4079f87e 695
9df3eecc
MV
696else
697
698guile-procedures.txt: guile-procedures.texi
f7742034 699 cp guile-procedures.texi $@
9df3eecc
MV
700
701endif
702
30e3be5a 703c-tokenize.c: c-tokenize.lex
47ac1e47 704 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
30e3be5a 705
d8a20ddb 706schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
8dc9439f 707schemelib_DATA = guile-procedures.txt
4079f87e 708
733943b9 709## Add -MG to make the .x magic work with auto-dep code.
47871d5a 710MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
ee78fbb0 711
648da032
TTN
712\f
713# This page is for maintenance of the lists of CPP symbols that are eventually
714# included in error.c (‘errno’ values: E*) and posix.c (signal names: SIG*),
715# in the funcs scm_init_{error,posix}, respectively.
716#
717# The lists (files cpp-{E,SIG}.syms) are not included verbatim, but processed
718# (via pattern rule ‘.syms.c’ below) so that each CPP symbol is transformed to
719# fragment of #ifdef'd C code that defines a Scheme variable of the same name.
720# The resulting files, cpp-{E,SIG}.c, are the ones #include:d.
721#
722# To maintain the (source) lists of symbols, we use a GCC-specific feature
723# to list all symbols #define:d when expanding <{errno,signal}.h>, grep
724# the output for {E,SIG}*, massage the result into a usable form, and
725# construct a union of the current and new symbols. This is written to
726# files cpp-{E,SIG}.syms.NEW for review. If things look ok, you can then
727# "mv foo.NEW foo" and commit. Generating the foo.NEW files and showing
728# an informative message is the job of targets chknew-{E,SIG}.
729
730# For each line in foo.syms, transform:
731# SYMBOL
732# to:
733# #ifdef SYMBOL
734# scm_c_define ("SYMBOL", scm_from_int (SYMBOL));
735# #endif
736# writing output to foo.c.
737.syms.c:
738 sed 's/.*/#ifdef &\nscm_c_define ("&", scm_from_int (&));\n#endif/' \
739 $< > $@T
740 mv $@T $@
741
742# Write $(srcdir)/cpp-{E,SIG}.syms.NEW if there are any not-yet-seen
743# ("new" to us) E* or SIG* symbols in <errno.h> or <signal.h>, respectively.
744chknew-E chknew-SIG:
745 @bit=`echo $@ | sed s/^chknew-//` ; \
746 old="$(srcdir)/cpp-$$bit.syms" ; \
747 echo "#include <$${bit}.h>" \
748 | sed 's/E/errno/;s/SIG/signal/' \
749 | gcc -undef -dM -E - \
750 | sed 's/^#define //;/^'$$bit'[A-Z][A-Z]*/!d;s/ .*//' \
751 | sort | diff -u $$old - | sed '1,2d;/^+/!d;s/^.//' \
752 > TMP ; \
753 if [ -s TMP ] ; then new="$$old.NEW" ; \
754 cat $$old TMP | sort > $$new ; \
755 echo "$$new: `sed -n '$$=' TMP` new symbol(s)." ; \
756 sed 's/^/ /' TMP ; \
757 else echo "No new symbols found." ; \
758 fi ; rm TMP
759
760\f
67ec3667 761
ad6b30a0 762MOSTLYCLEANFILES = \
d8a20ddb 763 version.h version.h.tmp \
23ccb831 764 scmconfig.h scmconfig.h.tmp
ad6b30a0 765
84595266
AW
766CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi \
767 vm-i-*.i
ee0c0e03
ML
768
769MAINTAINERCLEANFILES = c-tokenize.c