read-and-compile closes input file after seeing EOF
[bpt/guile.git] / libguile / Makefile.am
CommitLineData
733943b9 1## Process this file with Automake to create Makefile.in
2764bd99 2##
7b327550 3## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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
a04e5749
AW
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.
64c2db80 61gen-scmconfig.$(OBJEXT): gen-scmconfig.c
ad378da9
AW
62 $(AM_V_GEN) \
63 if [ "$(cross_compiling)" = "yes" ]; then \
a04e5749 64 $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) -I$(top_builddir) \
b3da54d1 65 -c -o $@ $<; \
ad378da9
AW
66 else \
67 $(COMPILE) -c -o $@ $<; \
64c2db80
RB
68 fi
69
2e945bcc 70## Override default rule; this should run on BUILD host.
6a6df187 71gen-scmconfig$(EXEEXT): $(gen_scmconfig_OBJECTS) $(gen_scmconfig_DEPENDENCIES)
a572fc95
NI
72 $(AM_V_GEN) \
73 rm -f gen-scmconfig$(EXEEXT); \
2e945bcc
SJ
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
80scmconfig.h: ${top_builddir}/config.h gen-scmconfig$(EXEEXT)
a572fc95
NI
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
64c2db80 88
b32fca0f
MV
89guile_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
93c-tokenize.$(OBJEXT): c-tokenize.c
a572fc95 94 $(AM_V_GEN) \
b32fca0f 95 if [ "$(cross_compiling)" = "yes" ]; then \
bb5b36d0 96 $(CC_FOR_BUILD) -c -o $@ $<; \
b32fca0f 97 else \
4ea57d5b 98 $(COMPILE) -c -o $@ $<; \
b32fca0f
MV
99 fi
100
101## Override default rule; this should run on BUILD host.
6a6df187 102guile_filter_doc_snarfage$(EXEEXT): $(guile_filter_doc_snarfage_OBJECTS) $(guile_filter_doc_snarfage_DEPENDENCIES)
a572fc95
NI
103 $(AM_V_GEN) \
104 rm -f guile_filter_doc_snarfage$(EXEEXT); \
b32fca0f
MV
105 if [ "$(cross_compiling)" = "yes" ]; then \
106 $(CCLD_FOR_BUILD) -o $@ $(guile_filter_doc_snarfage_OBJECTS); \
107 else \
3d458a81 108 $(LINK) $(guile_filter_doc_snarfage_OBJECTS) $(LDADD) $(gnulib_library) $(LIBS); \
b32fca0f
MV
109 fi
110
549436de
JB
111
112guile_SOURCES = guile.c
bfb2e113 113guile_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
44602b08 114guile_LDADD = libguile-@GUILE_EFFECTIVE_VERSION@.la
de7d32d0 115guile_LDFLAGS = $(GUILE_CFLAGS)
5bbc5359 116
44602b08 117libguile_@GUILE_EFFECTIVE_VERSION@_la_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
ee2a8b9b 118
44602b08 119libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = \
a4a0d399
AW
120 alist.c \
121 arbiters.c \
c53c0893 122 array-handle.c \
5d1b3b2d 123 array-map.c \
2fa901a5 124 arrays.c \
a4a0d399
AW
125 async.c \
126 backtrace.c \
127 boolean.c \
cf396142 128 bitvectors.c \
a4a0d399
AW
129 bytevectors.c \
130 chars.c \
b9c100d0 131 control.c \
a4a0d399
AW
132 continuations.c \
133 debug.c \
134 deprecated.c \
135 deprecation.c \
a4a0d399
AW
136 dynwind.c \
137 eq.c \
138 error.c \
139 eval.c \
140 evalext.c \
dc3e203e 141 expand.c \
a4a0d399
AW
142 extensions.c \
143 feature.c \
073167ef 144 filesys.c \
7b327550 145 finalizers.c \
a4a0d399 146 fluids.c \
e2c2a699 147 foreign.c \
a4a0d399
AW
148 fports.c \
149 frames.c \
a4a0d399 150 gc-malloc.c \
a4a0d399 151 gc.c \
a4a0d399
AW
152 gdbint.c \
153 gettext.c \
1030b450 154 generalized-arrays.c \
f332e957 155 generalized-vectors.c \
a4a0d399
AW
156 goops.c \
157 gsubr.c \
158 guardians.c \
159 hash.c \
160 hashtab.c \
161 hooks.c \
756e8a3a 162 i18n.c \
a4a0d399
AW
163 init.c \
164 inline.c \
165 instructions.c \
166 ioext.c \
167 keywords.c \
a4a0d399
AW
168 list.c \
169 load.c \
170 macros.c \
171 mallocs.c \
b7742c6b 172 memoize.c \
a4a0d399
AW
173 modules.c \
174 null-threads.c \
175 numbers.c \
176 objcodes.c \
a4a0d399
AW
177 objprop.c \
178 options.c \
179 pairs.c \
6f81b18a 180 poll.c \
a4a0d399
AW
181 ports.c \
182 print.c \
183 procprop.c \
184 procs.c \
185 programs.c \
7b893819 186 promises.c \
a4a0d399 187 r6rs-ports.c \
a4a0d399
AW
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 \
37710f7e
AW
199 srfi-1.c \
200 srfi-4.c \
a4a0d399
AW
201 srfi-13.c \
202 srfi-14.c \
37710f7e 203 srfi-60.c \
a4a0d399
AW
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 \
0f458a37 214 trees.c \
476b894c 215 uniform.c \
a4a0d399
AW
216 values.c \
217 variable.c \
218 vectors.c \
219 version.c \
220 vm.c \
221 vports.c \
222 weaks.c
83495480 223
a4a0d399
AW
224DOT_X_FILES = \
225 alist.x \
226 arbiters.x \
c53c0893 227 array-handle.x \
5d1b3b2d 228 array-map.x \
2fa901a5 229 arrays.x \
a4a0d399
AW
230 async.x \
231 backtrace.x \
232 boolean.x \
cf396142 233 bitvectors.x \
a4a0d399
AW
234 bytevectors.x \
235 chars.x \
b9c100d0 236 control.x \
a4a0d399
AW
237 continuations.x \
238 debug.x \
239 deprecated.x \
240 deprecation.x \
a4a0d399
AW
241 dynl.x \
242 dynwind.x \
243 eq.x \
244 error.x \
245 eval.x \
246 evalext.x \
dc3e203e 247 expand.x \
a4a0d399
AW
248 extensions.x \
249 feature.x \
ee037cee 250 filesys.x \
a4a0d399 251 fluids.x \
e2c2a699 252 foreign.x \
a4a0d399 253 fports.x \
a4a0d399 254 gc-malloc.x \
a4a0d399
AW
255 gc.x \
256 gettext.x \
1030b450 257 generalized-arrays.x \
f332e957 258 generalized-vectors.x \
a4a0d399
AW
259 goops.x \
260 gsubr.x \
261 guardians.x \
262 hash.x \
263 hashtab.x \
264 hooks.x \
265 i18n.x \
266 init.x \
267 ioext.x \
268 keywords.x \
a4a0d399
AW
269 list.x \
270 load.x \
271 macros.x \
272 mallocs.x \
b7742c6b 273 memoize.x \
a4a0d399
AW
274 modules.x \
275 numbers.x \
a4a0d399
AW
276 objprop.x \
277 options.x \
278 pairs.x \
279 ports.x \
280 print.x \
281 procprop.x \
282 procs.x \
7b893819 283 promises.x \
a4a0d399 284 r6rs-ports.x \
a4a0d399
AW
285 random.x \
286 rdelim.x \
287 read.x \
288 root.x \
289 rw.x \
290 scmsigs.x \
291 script.x \
292 simpos.x \
293 smob.x \
294 sort.x \
295 srcprop.x \
37710f7e
AW
296 srfi-1.x \
297 srfi-4.x \
a4a0d399
AW
298 srfi-13.x \
299 srfi-14.x \
37710f7e 300 srfi-60.x \
a4a0d399
AW
301 stackchk.x \
302 stacks.x \
303 stime.x \
304 strings.x \
305 strorder.x \
306 strports.x \
307 struct.x \
308 symbols.x \
309 threads.x \
310 throw.x \
0f458a37 311 trees.x \
476b894c 312 uniform.x \
a4a0d399
AW
313 values.x \
314 variable.x \
315 vectors.x \
316 version.x \
317 vports.x \
318 weaks.x
8bee78b3 319
83495480
AW
320# vm-related snarfs
321DOT_X_FILES += frames.x instructions.x objcodes.x programs.x vm.x
322
e9e225e5 323EXTRA_DOT_X_FILES = @EXTRA_DOT_X_FILES@
8bee78b3 324
a4a0d399
AW
325DOT_DOC_FILES = \
326 alist.doc \
327 arbiters.doc \
c53c0893 328 array-handle.doc \
5d1b3b2d 329 array-map.doc \
2fa901a5 330 arrays.doc \
a4a0d399
AW
331 async.doc \
332 backtrace.doc \
333 boolean.doc \
cf396142 334 bitvectors.doc \
a4a0d399
AW
335 bytevectors.doc \
336 chars.doc \
b9c100d0 337 control.doc \
a4a0d399
AW
338 continuations.doc \
339 debug.doc \
340 deprecated.doc \
341 deprecation.doc \
a4a0d399
AW
342 dynl.doc \
343 dynwind.doc \
344 eq.doc \
345 error.doc \
346 eval.doc \
347 evalext.doc \
dc3e203e 348 expand.doc \
a4a0d399
AW
349 extensions.doc \
350 feature.doc \
073167ef 351 filesys.doc \
a4a0d399 352 fluids.doc \
e2c2a699 353 foreign.doc \
a4a0d399 354 fports.doc \
a4a0d399 355 gc-malloc.doc \
a4a0d399
AW
356 gc.doc \
357 gettext.doc \
1030b450 358 generalized-arrays.doc \
476b894c 359 generalized-vectors.doc \
a4a0d399
AW
360 goops.doc \
361 gsubr.doc \
362 guardians.doc \
363 hash.doc \
364 hashtab.doc \
365 hooks.doc \
366 i18n.doc \
367 init.doc \
368 ioext.doc \
369 keywords.doc \
a4a0d399
AW
370 list.doc \
371 load.doc \
372 macros.doc \
373 mallocs.doc \
b7742c6b 374 memoize.doc \
a4a0d399
AW
375 modules.doc \
376 numbers.doc \
a4a0d399
AW
377 objprop.doc \
378 options.doc \
379 pairs.doc \
380 ports.doc \
381 print.doc \
382 procprop.doc \
383 procs.doc \
7b893819 384 promises.doc \
a4a0d399 385 r6rs-ports.doc \
a4a0d399
AW
386 random.doc \
387 rdelim.doc \
388 read.doc \
389 root.doc \
390 rw.doc \
391 scmsigs.doc \
392 script.doc \
393 simpos.doc \
394 smob.doc \
395 sort.doc \
396 srcprop.doc \
37710f7e
AW
397 srfi-1.doc \
398 srfi-4.doc \
a4a0d399
AW
399 srfi-13.doc \
400 srfi-14.doc \
37710f7e 401 srfi-60.doc \
a4a0d399
AW
402 stackchk.doc \
403 stacks.doc \
404 stime.doc \
405 strings.doc \
406 strorder.doc \
407 strports.doc \
408 struct.doc \
409 symbols.doc \
410 threads.doc \
411 throw.doc \
0f458a37 412 trees.doc \
476b894c 413 uniform.doc \
a4a0d399
AW
414 values.doc \
415 variable.doc \
416 vectors.doc \
417 version.doc \
418 vports.doc \
419 weaks.doc
a3365d47 420
2ce88b54 421EXTRA_DOT_DOC_FILES = @EXTRA_DOT_DOC_FILES@
9515eae6 422
83495480
AW
423DOT_I_FILES = vm-i-system.i vm-i-scheme.i vm-i-loader.i
424
425.c.i:
a572fc95 426 $(AM_V_GEN)$(GREP) '^VM_DEFINE' $< > $@
83495480 427
648da032 428BUILT_SOURCES = cpp-E.c cpp-SIG.c libpath.h \
b405cdb4 429 scmconfig.h \
83495480 430 $(DOT_I_FILES) $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
9515eae6 431
44602b08 432EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \
c32b39b9 433 memmove.c strerror.c \
f731051e 434 dynl.c regex-posix.c \
073167ef 435 posix.c net_db.c socket.c \
29627818 436 debug-malloc.c mkstemp.c \
95643853 437 win32-uname.c win32-socket.c \
b89c4943 438 locale-categories.h
7bfd3b9e 439
413a1367
ML
440## delete guile-snarf.awk from the installation bindir, in case it's
441## lingering there due to an earlier guile version not having been
442## wiped out.
443install-exec-hook:
b27b814d 444 rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
413a1367 445
7bfd3b9e 446## This is kind of nasty... there are ".c" files that we don't want to
1be6b49c
ML
447## compile, since they are #included. So instead we list them here.
448## Perhaps we can deal with them normally once the merge seems to be
449## working.
4b126598 450noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c \
71560395 451 srfi-14.i.c \
06f9c814 452 quicksort.i.c \
95643853 453 win32-uname.h win32-socket.h \
981ff600 454 private-gc.h private-options.h
7bfd3b9e 455
83495480
AW
456# vm instructions
457noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
458
44602b08 459libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES = @LIBLOBJS@
abd7e37a 460
18f2d5aa 461libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD = \
cae0945c
LC
462 @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) $(LTLIBLTDL)
463
464# Libtool version info.
465version_info = @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@
466
467libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS = \
468 $(BDW_GC_LIBS) $(LIBFFI_LIBS) \
dd36ce77 469 $(CEIL_LIBM) \
cae0945c 470 $(FLOOR_LIBM) \
dd36ce77 471 $(FREXP_LIBM) \
cae0945c
LC
472 $(GETADDRINFO_LIB) \
473 $(HOSTENT_LIB) \
474 $(INET_NTOP_LIB) \
475 $(INET_PTON_LIB) \
476 $(ISNAND_LIBM) \
477 $(ISNANF_LIBM) \
478 $(ISNANL_LIBM) \
dd36ce77 479 $(LDEXP_LIBM) \
cae0945c 480 $(LIBSOCKET) \
235c2804 481 $(LIB_CLOCK_GETTIME) \
cae0945c 482 $(LOG1P_LIBM) \
005de2e8 483 $(LOG_LIBM) \
cae0945c
LC
484 $(LTLIBICONV) \
485 $(LTLIBINTL) \
486 $(LTLIBUNISTRING) \
005de2e8 487 $(ROUND_LIBM) \
cae0945c
LC
488 $(SERVENT_LIB) \
489 $(TRUNC_LIBM) \
490 -version-info $(version_info) \
491 -export-dynamic -no-undefined \
76e8a758 492 $(GNU_LD_FLAGS)
733943b9 493
9af080f7
LC
494if HAVE_LD_VERSION_SCRIPT
495
44602b08 496libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS += -Wl,--version-script="$(srcdir)/libguile.map"
9af080f7
LC
497
498endif HAVE_LD_VERSION_SCRIPT
499
500
54f16aec 501# These are headers visible as <guile/mumble.h>
6a6df187 502pkginclude_HEADERS =
ee2a8b9b 503
733943b9 504# These are headers visible as <libguile/mumble.h>.
718815d7 505modincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)/libguile
a4a0d399
AW
506modinclude_HEADERS = \
507 __scm.h \
508 alist.h \
509 arbiters.h \
c53c0893 510 array-handle.h \
5d1b3b2d 511 array-map.h \
2fa901a5 512 arrays.h \
a4a0d399
AW
513 async.h \
514 backtrace.h \
1c44468d 515 bdw-gc.h \
a4a0d399 516 boolean.h \
cf396142 517 bitvectors.h \
a4a0d399
AW
518 bytevectors.h \
519 chars.h \
b9c100d0 520 control.h \
a4a0d399
AW
521 continuations.h \
522 debug-malloc.h \
523 debug.h \
524 deprecated.h \
525 deprecation.h \
a4a0d399
AW
526 dynl.h \
527 dynwind.h \
528 eq.h \
529 error.h \
530 eval.h \
531 evalext.h \
dc3e203e 532 expand.h \
a4a0d399
AW
533 extensions.h \
534 feature.h \
7b327550 535 finalizers.h \
a4a0d399
AW
536 filesys.h \
537 fluids.h \
e2c2a699 538 foreign.h \
a4a0d399
AW
539 fports.h \
540 frames.h \
a4a0d399
AW
541 gc.h \
542 gdb_interface.h \
543 gdbint.h \
544 gettext.h \
1030b450 545 generalized-arrays.h \
f332e957 546 generalized-vectors.h \
a4a0d399
AW
547 goops.h \
548 gsubr.h \
549 guardians.h \
550 hash.h \
551 hashtab.h \
552 hooks.h \
553 i18n.h \
554 init.h \
555 inline.h \
556 instructions.h \
557 ioext.h \
558 iselect.h \
559 keywords.h \
a4a0d399
AW
560 list.h \
561 load.h \
562 macros.h \
563 mallocs.h \
b7742c6b 564 memoize.h \
a4a0d399
AW
565 modules.h \
566 net_db.h \
567 null-threads.h \
568 numbers.h \
569 objcodes.h \
a4a0d399
AW
570 objprop.h \
571 options.h \
572 pairs.h \
6f81b18a 573 poll.h \
a4a0d399
AW
574 ports.h \
575 posix.h \
576 print.h \
577 procprop.h \
578 procs.h \
579 programs.h \
7b893819 580 promises.h \
a4a0d399
AW
581 pthread-threads.h \
582 r6rs-ports.h \
a4a0d399
AW
583 random.h \
584 rdelim.h \
585 read.h \
586 regex-posix.h \
587 root.h \
588 rw.h \
589 scmsigs.h \
590 script.h \
591 simpos.h \
592 smob.h \
593 snarf.h \
594 socket.h \
595 sort.h \
596 srcprop.h \
37710f7e
AW
597 srfi-1.h \
598 srfi-4.h \
a4a0d399
AW
599 srfi-13.h \
600 srfi-14.h \
37710f7e 601 srfi-60.h \
a4a0d399
AW
602 stackchk.h \
603 stacks.h \
604 stime.h \
605 strings.h \
606 strorder.h \
607 strports.h \
608 struct.h \
609 symbols.h \
610 tags.h \
611 threads.h \
612 throw.h \
0f458a37 613 trees.h \
a4a0d399 614 validate.h \
476b894c 615 uniform.h \
a4a0d399
AW
616 values.h \
617 variable.h \
618 vectors.h \
a4a0d399
AW
619 vm-engine.h \
620 vm-expand.h \
621 vm.h \
622 vports.h \
623 weaks.h
83495480 624
93ff93f6 625nodist_modinclude_HEADERS = version.h scmconfig.h
733943b9 626
604a672e
TTN
627bin_SCRIPTS = guile-snarf
628
f94b6524
TTN
629# We can re-enable install for some of these if/when they are documented
630# and people feel like maintaining them. For now, this is not the case.
2d6a14ad 631noinst_SCRIPTS = guile-snarf-docs
adb75a41 632
89bc270d 633EXTRA_DIST = ChangeLog-scm ChangeLog-threads \
648da032 634 ChangeLog-1996-1999 ChangeLog-2000 ChangeLog-2008 \
2d6a14ad 635 guile-func-name-check \
648da032 636 cpp-E.syms cpp-E.c cpp-SIG.syms cpp-SIG.c \
b405cdb4 637 c-tokenize.lex \
f49dbcad 638 scmconfig.h.top libgettext.h unidata_to_charset.pl libguile.map
c99f9605
ML
639# $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
640# guile-procedures.txt guile.texi
733943b9 641
fef07353 642## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
90ff3ec5 643libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
e151bee6
JB
644 @rm -f libpath.tmp
645 @echo '/* generated by Makefile */' > libpath.tmp
646 @echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
d8a20ddb 647 @echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)"'>>libpath.tmp
d5a1a8cd 648 @echo '#define SCM_SITE_DIR "$(sitedir)"' >> libpath.tmp
bc325e76 649 @echo '#define SCM_GLOBAL_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
28af5ee5
AW
650 @echo '#define SCM_LIB_DIR "$(libdir)"' >> libpath.tmp
651 @echo '#define SCM_EXTENSIONS_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions"' >> libpath.tmp
5b197db8 652 @echo '#define SCM_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/ccache"' >> libpath.tmp
9957641b 653 @echo '#define SCM_SITE_CCACHE_DIR "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache"' >> libpath.tmp
5b197db8 654 @echo '#define SCM_EFFECTIVE_VERSION "$(GUILE_EFFECTIVE_VERSION)"' >> libpath.tmp
e151bee6
JB
655 @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
656 @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
c565712c 657 @echo ' { "top_srcdir", "@top_srcdir_absolute@" }, \' >> libpath.tmp
e151bee6
JB
658 @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp
659 @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp
660 @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp
661 @echo ' { "sbindir", "@sbindir@" }, \' >> libpath.tmp
662 @echo ' { "libexecdir", "@libexecdir@" }, \' >> libpath.tmp
663 @echo ' { "datadir", "@datadir@" }, \' >> libpath.tmp
664 @echo ' { "sysconfdir", "@sysconfdir@" }, \' >> libpath.tmp
665 @echo ' { "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
666 @echo ' { "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
667 @echo ' { "libdir", "@libdir@" }, \' >> libpath.tmp
5b197db8 668 @echo ' { "ccachedir", SCM_CCACHE_DIR }, \' >> libpath.tmp
e151bee6
JB
669 @echo ' { "infodir", "@infodir@" }, \' >> libpath.tmp
670 @echo ' { "mandir", "@mandir@" }, \' >> libpath.tmp
671 @echo ' { "includedir", "@includedir@" }, \' >> libpath.tmp
eb350124
AW
672 @echo ' { "pkgdatadir", "$(pkgdatadir)" }, \' >> libpath.tmp
673 @echo ' { "pkglibdir", "$(pkglibdir)" }, \' >> libpath.tmp
674 @echo ' { "pkgincludedir", "$(pkgincludedir)" }, \' \
e151bee6 675 >> libpath.tmp
869bfe86 676 @echo ' { "extensiondir", "$(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/extensions" }, \' >> libpath.tmp
b6fae158 677 @echo ' { "guileversion", "@GUILE_VERSION@" }, \' >> libpath.tmp
54f16aec
TTN
678 @echo ' { "libguileinterface", "@LIBGUILE_INTERFACE@" }, \' \
679 >> libpath.tmp
30dda257 680 @echo ' { "LIBS", "@GUILE_LIBS@" }, \' >> libpath.tmp
5bbc5359 681 @echo ' { "CFLAGS", "@GUILE_CFLAGS@" }, \' >> libpath.tmp
a6025413 682 @echo ' { "buildstamp", "'`date -u +'%Y-%m-%d %T'`'" }, \' >> libpath.tmp
e151bee6 683 @echo '}' >> libpath.tmp
a572fc95 684 $(AM_V_GEN)mv libpath.tmp libpath.h
733943b9 685
3dc81fba 686
47871d5a 687snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
e9c3d3f9 688
3dc81fba 689SUFFIXES = .x .doc
a572fc95 690
733943b9 691.c.x:
a572fc95 692 $(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts)
c99f9605 693.c.doc:
e6d67f1e 694 $(AM_V_SNARF)./guile-snarf-docs -o $@ $< -- $(snarfcppopts)
733943b9 695
f9560a34 696$(DOT_X_FILES) $(EXTRA_DOT_X_FILES): scmconfig.h snarf.h guile-snarf.in version.h
c99f9605 697
23f2b9a3 698$(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES): scmconfig.h snarf.h guile-snarf-docs.in guile_filter_doc_snarfage$(EXEEXT)
66418d34 699
648da032
TTN
700error.x: cpp-E.c
701posix.x: cpp-SIG.c
faf6a29b
MV
702load.x: libpath.h
703
f8241358 704alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
b8b06598 705snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guild snarf-check-and-output-texi
f8241358
TTN
706dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi)
707
2e945bcc 708guile.texi: $(alldotdocfiles) guile$(EXEEXT)
f8241358
TTN
709 $(dotdoc2texi) --manual > $@ || { rm $@; false; }
710
2e945bcc 711guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
a572fc95 712 $(AM_V_GEN)$(dotdoc2texi) > $@ || { rm $@; false; }
9d29e990 713
9df3eecc
MV
714if HAVE_MAKEINFO
715
cecb4a5e 716guile-procedures.txt: guile-procedures.texi
9d29e990 717 rm -f $@
f7742034 718 makeinfo --force -o $@ guile-procedures.texi || test -f $@
4079f87e 719
9df3eecc
MV
720else
721
722guile-procedures.txt: guile-procedures.texi
f7742034 723 cp guile-procedures.texi $@
9df3eecc
MV
724
725endif
726
30e3be5a 727c-tokenize.c: c-tokenize.lex
47ac1e47 728 flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
30e3be5a 729
d8a20ddb 730schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
8dc9439f 731schemelib_DATA = guile-procedures.txt
4079f87e 732
733943b9 733## Add -MG to make the .x magic work with auto-dep code.
47871d5a 734MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
ee78fbb0 735
648da032
TTN
736\f
737# This page is for maintenance of the lists of CPP symbols that are eventually
738# included in error.c (‘errno’ values: E*) and posix.c (signal names: SIG*),
739# in the funcs scm_init_{error,posix}, respectively.
740#
741# The lists (files cpp-{E,SIG}.syms) are not included verbatim, but processed
742# (via pattern rule ‘.syms.c’ below) so that each CPP symbol is transformed to
743# fragment of #ifdef'd C code that defines a Scheme variable of the same name.
744# The resulting files, cpp-{E,SIG}.c, are the ones #include:d.
745#
746# To maintain the (source) lists of symbols, we use a GCC-specific feature
747# to list all symbols #define:d when expanding <{errno,signal}.h>, grep
748# the output for {E,SIG}*, massage the result into a usable form, and
749# construct a union of the current and new symbols. This is written to
750# files cpp-{E,SIG}.syms.NEW for review. If things look ok, you can then
751# "mv foo.NEW foo" and commit. Generating the foo.NEW files and showing
752# an informative message is the job of targets chknew-{E,SIG}.
753
754# For each line in foo.syms, transform:
755# SYMBOL
756# to:
757# #ifdef SYMBOL
758# scm_c_define ("SYMBOL", scm_from_int (SYMBOL));
759# #endif
319b53dd
TTN
760# writing output to foo.c. We use a while-read loop instead of a
761# one-line sed script because some seds (e.g., FreeBSD) don't read
762# '\n' as a newline (like GNU sed does). Sad, but true.
648da032 763.syms.c:
bfebf099 764 $(AM_V_GEN) \
319b53dd
TTN
765 cat $< | while read sym ; do \
766 echo "#ifdef $$sym" ; \
767 echo "scm_c_define (\"$$sym\", scm_from_int ($$sym));" ; \
768 echo "#endif" ; \
769 done > $@T
bfebf099 770 @mv $@T $@
648da032
TTN
771
772# Write $(srcdir)/cpp-{E,SIG}.syms.NEW if there are any not-yet-seen
773# ("new" to us) E* or SIG* symbols in <errno.h> or <signal.h>, respectively.
9253d090 774chknew-E chknew-SIG: \
648da032
TTN
775 @bit=`echo $@ | sed s/^chknew-//` ; \
776 old="$(srcdir)/cpp-$$bit.syms" ; \
777 echo "#include <$${bit}.h>" \
778 | sed 's/E/errno/;s/SIG/signal/' \
9253d090 779 | gcc -dM -E - \
648da032
TTN
780 | sed 's/^#define //;/^'$$bit'[A-Z][A-Z]*/!d;s/ .*//' \
781 | sort | diff -u $$old - | sed '1,2d;/^+/!d;s/^.//' \
782 > TMP ; \
783 if [ -s TMP ] ; then new="$$old.NEW" ; \
784 cat $$old TMP | sort > $$new ; \
785 echo "$$new: `sed -n '$$=' TMP` new symbol(s)." ; \
786 sed 's/^/ /' TMP ; \
787 else echo "No new symbols found." ; \
788 fi ; rm TMP
789
790\f
67ec3667 791
ad6b30a0 792MOSTLYCLEANFILES = \
23ccb831 793 scmconfig.h scmconfig.h.tmp
ad6b30a0 794
84595266
AW
795CLEANFILES = libpath.h *.x *.doc guile-procedures.txt guile-procedures.texi guile.texi \
796 vm-i-*.i
ee0c0e03
ML
797
798MAINTAINERCLEANFILES = c-tokenize.c