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