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