beta-0.89.2
[luatex.git] / source / texk / web2c / am / bootstrap.am
blobf37c6ddbcd63cbd1d33be5b96a58815b8a7a6c59
1 ## texk/web2c/am/bootstrap.am: Makefile fragment for tangle and ctangle.
2 ##
3 ## Copyright (C) 2009-2015 Peter Breitenlohner <tex-live@tug.org>
4 ## You may freely use, modify and/or distribute this file.
6 cp_silent = $(cp_silent_@AM_V@)
7 cp_silent_ = $(cp_silent_@AM_DEFAULT_V@)
8 cp_silent_0 = @echo "  COPY    " $@;
9 cp_silent_1 =
11 # Bootstrapping tangle requires making it with itself.  We use the opportunity
12 # to create an up-to-date tangleboot.pin as well.
13 bin_PROGRAMS += tangle
14 nodist_tangle_SOURCES = tangle.c tangle.h
15 tangle.c tangle.h: tangle-web2c
16         @$(web2c) tangle
17 tangle-web2c: tangle.p $(web2c_depend)
18         @$(web2c) tangle
19 # tangle.p is a special case, since it is needed to compile itself.  We
20 # convert and compile the (distributed) tangleboot.pin to make a tangle
21 # which we use to make the other programs.  We depend on tangleboot, even
22 # though we might not use it.
23 tangle.p: tangleboot$(EXEEXT) tangle.web tangle.ch
24         $(tangleboot) tangle tangle
25         @cmp -s tangle.p $(srcdir)/tangleboot.pin || { \
26           if $(AM_V_P); then \
27             echo "Updating tangle.p => $(srcdir)/tangleboot.pin"; \
28           else \
29             echo "  UPD     " tangleboot.pin; \
30           fi; cp -f tangle.p $(srcdir)/tangleboot.pin; }
31 tangle.web:
32         @echo "You seem to be missing tangle.web, perhaps because you" >&2
33         @echo "didn't retrieve web.tar.gz, only web2c.tar.gz." >&2
34         @echo "You need both." >&2
35         @echo >&2
36         @echo "web.tar.gz should be available from the" >&2
37         @echo "same place that you got web2c.tar.gz." >&2
38         @echo "In any case, you can get it from" >&2
39         @echo "ftp://ftp.tug.org/tex/web.tar.gz." >&2
40         false
41 EXTRA_DIST += tangle.web tangle.ch
42 DISTCLEANFILES += tangle.c tangle.h tangle.p tangle-web2c
44 noinst_PROGRAMS += tangleboot
45 nodist_tangleboot_SOURCES = tangleboot.c tangleboot.h
46 tangleboot.c tangleboot.h: tangleboot-web2c
47         @$(web2c) tangleboot
48 tangleboot-web2c: tangleboot.p $(web2c_depend)
49         @$(web2c) tangleboot
50 # tangleboot.pin is in the distribution
51 .pin.p:
52         $(cp_silent)cp -f $< $@
53 $(tangleboot_OBJECTS): $(tangleboot_DEPENDENCIES)
54 tangleboot_DEPENDENCIES = $(default_dependencies)
55 EXTRA_DIST += tangleboot.pin
56 DISTCLEANFILES += tangleboot.c tangleboot.h tangleboot.p tangleboot-web2c
58 # Bootstrapping ctangle requires making it with itself.  We use the opportunity
59 # to create an up-to-date ctangleboot.cin and cwebboot.[ch]in as well.
60 bin_PROGRAMS += ctangle
61 nodist_ctangle_SOURCES = ctangle.c cweb.c
62 $(ctangle_OBJECTS): cweb.h
63 # ctangle.c and cweb.[ch] are special cases, since they are needed to compile
64 # themselves.  We depend on ctangleboot, even though we might not use it.
65 ctangleboot = AM_V_P=$(AM_V_P) $(SHELL) ./ctangleboot-sh $@
66 ctangle.c: ctangleboot$(EXEEXT) cwebdir/common.h cwebdir/ctangle.w cwebdir/ctang-w2c.ch ctangleboot-sh
67         @$(ctangleboot) ctangle ctang-w2c
68 cweb.c cweb.h: common-ctangle
69         @$(ctangleboot) common comm-w2c cweb.c
70 common-ctangle: ctangleboot$(EXEEXT) cwebdir/common.w cwebdir/comm-w2c.ch ctangleboot-sh
71         @$(ctangleboot) common comm-w2c cweb.c
72 EXTRA_DIST += cwebdir
73 NEVER_DIST += cwebdir/cweave.log cwebdir/cweave.trs
74 ## We install man/cweb.man, not cwebdir/cweb.1
75 ## nodist_man_MANS += cwebdir/cweb.1
76 DISTCLEANFILES += ctangle.c cweb.c cweb.h common-ctangle
78 noinst_PROGRAMS += ctangleboot
79 nodist_ctangleboot_SOURCES = ctangleboot.c cwebboot.c
80 $(ctangleboot_OBJECTS): cwebboot.h $(ctangleboot_DEPENDENCIES)
81 # ctangleboot.cin and cwebboot.[ch]in are in the distribution
82 .cin.c:
83         $(cp_silent)cp -f $< $@
84 .hin.h:
85         $(cp_silent)cp -f $< $@
86 ctangleboot_DEPENDENCIES = $(default_dependencies)
87 EXTRA_DIST += ctangleboot.cin cwebboot.cin cwebboot.hin
88 DISTCLEANFILES += ctangleboot.c cwebboot.c cwebboot.h
90 ## Tests
92 EXTRA_DIST += tangle.test
94 TESTS += tangle.test
95 tangle.log: tangle$(EXEEXT)
97 DISTCLEANFILES += cftest.p