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