summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/am/bootstrap.am
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/am/bootstrap.am')
-rw-r--r--Build/source/texk/web2c/am/bootstrap.am101
1 files changed, 38 insertions, 63 deletions
diff --git a/Build/source/texk/web2c/am/bootstrap.am b/Build/source/texk/web2c/am/bootstrap.am
index e7191ae311a..13bf32dfd56 100644
--- a/Build/source/texk/web2c/am/bootstrap.am
+++ b/Build/source/texk/web2c/am/bootstrap.am
@@ -4,20 +4,20 @@
## You may freely use, modify and/or distribute this file.
# Bootstrapping tangle requires making it with itself. We use the opportunity
-# to create an up-to-date tangleboot.p as well.
+# to create an up-to-date tangleboot.pin as well.
bin_PROGRAMS += tangle
nodist_tangle_SOURCES = tangle.c tangle.h
tangle.c tangle.h: tangle-web2c
-tangle-web2c: tangle.p
- $(web2c) tangle
- echo timestamp >$@
- touch tangle.c tangle.h
+ @$(web2c) tangle
+tangle-web2c: tangle.p $(web2c_depend)
+ @$(web2c) tangle
# tangle.p is a special case, since it is needed to compile itself. We
-# convert and compile the (distributed) tangleboot.p to make a tangle
+# convert and compile the (distributed) tangleboot.pin to make a tangle
# which we use to make the other programs. We depend on tangleboot, even
# though we might not use it.
tangle.p: tangleboot$(EXEEXT) tangle.web tangle.ch
WEBINPUTS=.:$(srcdir) $(tangleboot) tangle tangle
+ cmp -s tangle.p $(srcdir)/tangleboot.pin || cp -f tangle.p $(srcdir)/tangleboot.pin
tangle.web:
@echo "You seem to be missing tangle.web, perhaps because you" >&2
@echo "didn't retrieve web.tar.gz, only web2c.tar.gz." >&2
@@ -33,73 +33,48 @@ DISTCLEANFILES += tangle.c tangle.h tangle.p tangle-web2c
noinst_PROGRAMS += tangleboot
nodist_tangleboot_SOURCES = tangleboot.c tangleboot.h
-tangleboot.c tangleboot.h: stamp-tangle $(web2c_depend)
- $(web2c) tangleboot
-# tangleboot.p is in the distribution
-stamp-tangle: tangleboot.p
- date >stamp-tangle
-EXTRA_DIST += tangleboot.p
-# This is not run unless tangle.web or tangle.ch is changed.
-# Only try to run ./tangle if it actually exists, otherwise
-# just touch tangleboot.p and build tangle.
-tangleboot.p: tangle.web tangle.ch
- if [ -r $(TANGLE) ] || [ -r $(TANGLE).exe ]; then \
- $(tangle) tangle tangle; \
- mv tangle.p tangleboot.p; \
- elif [ -r tangleboot.p ]; then \
- touch tangleboot.p; \
- else \
- cp $(srcdir)/tangleboot.p .; \
- fi
- date >stamp-tangle
- $(MAKE) $(AM_MAKEFLAGS) tangle$(EXEEXT)
-DISTCLEANFILES += stamp-tangle tangleboot.c tangleboot.h
+tangleboot.c tangleboot.h: tangleboot-web2c
+ @$(web2c) tangleboot
+tangleboot-web2c: tangleboot.p $(web2c_depend)
+ @$(web2c) tangleboot
+# tangleboot.pin is in the distribution
+tangleboot.p:
+ cp -f $(srcdir)/$@in $@
+tangleboot_DEPENDENCIES = $(default_dependencies)
+EXTRA_DIST += tangleboot.pin
+DISTCLEANFILES += tangleboot.c tangleboot.h tangleboot.p tangleboot-web2c
# Bootstrapping ctangle requires making it with itself. We use the opportunity
-# to create an up-to-date ctangleboot.c and cwebboot.c as well.
+# to create an up-to-date ctangleboot.cin and cwebboot.[ch]in as well.
bin_PROGRAMS += ctangle
nodist_ctangle_SOURCES = ctangle.c cweb.c
-# ctangle.c is a special case, since it is needed to compile itself.
-# We depend on ctangleboot, even though we might not use it.
-ctangle.c: ctangleboot$(EXEEXT) cwebdir/ctangle.w cwebdir/ctang-w2c.ch
- CWEBINPUTS=$(srcdir)/cwebdir $(ctangleboot) ctangle ctang-w2c
-cweb.c: ctangleboot$(EXEEXT) cwebdir/common.w cwebdir/comm-w2c.ch
- CWEBINPUTS=$(srcdir)/cwebdir $(ctangleboot) common comm-w2c cweb.c
+$(ctangle_OBJECTS): cweb.h
+ctangle_CFLAGS = $(WARNING_CFLAGS)
+# ctangle.c and cweb.[ch] are special cases, since they are needed to compile
+# themselves. We depend on ctangleboot, even though we might not use it.
+ctangleboot = $(SHELL) ./ctangleboot-sh $@
+ctangle.c: ctangle-ctangle
+ @$(ctangleboot) ctangle ctang-w2c
+ctangle-ctangle: ctangleboot$(EXEEXT) cwebdir/common.h cwebdir/ctangle.w cwebdir/ctang-w2c.ch ctangleboot-sh
+ @$(ctangleboot) ctangle ctang-w2c
+cweb.c cweb.h: common-ctangle
+ @$(ctangleboot) common comm-w2c cweb.c
+common-ctangle: ctangleboot$(EXEEXT) cwebdir/common.w cwebdir/comm-w2c.ch ctangleboot-sh
+ @$(ctangleboot) common comm-w2c cweb.c
EXTRA_DIST += cwebdir
## We install man/cweb.man, not cwebdir/cweb.1
## nodist_man_MANS += cwebdir/cweb.1
-DISTCLEANFILES += ctangle.c cweb.c
+DISTCLEANFILES += ctangle.c cweb.c cweb.h ctangle-ctangle common-ctangle
noinst_PROGRAMS += ctangleboot
nodist_ctangleboot_SOURCES = ctangleboot.c cwebboot.c
-# ctangleboot.c and cwebboot.c are in the distribution
-$(ctangleboot_OBJECTS): stamp-ctangle
-stamp-ctangle: ctangleboot.c cwebboot.c
- date >stamp-ctangle
-EXTRA_DIST += ctangleboot.c cwebboot.c
-# This is not run unless one of the cwebdir/* files is changed.
-# Only try to run ./ctangle if it actually exists, otherwise
-# just touch ctangleboot.c and/or cwebboot.c and build ctangle.
-# We must serialize this.
-ctangleboot.c: cwebboot.c cwebdir/ctangle.w cwebdir/ctang-w2c.ch
- if [ -r $(CTANGLE) ] || [ -r $(CTANGLE).exe ]; then \
- CWEBINPUTS=$(srcdir)/cwebdir $(ctangle) ctangle ctang-w2c ctangleboot.c; \
- elif [ -r ctangleboot.c ]; then \
- touch ctangleboot.c; \
- else \
- cp $(srcdir)/ctangleboot.c .; \
- fi
- date >stamp-ctangle
- $(MAKE) $(AM_MAKEFLAGS) ctangle$(EXEEXT)
-cwebboot.c: cwebdir/common.w cwebdir/comm-w2c.ch
- if [ -r $(CTANGLE) ] || [ -r $(CTANGLE).exe ]; then \
- CWEBINPUTS=$(srcdir)/cwebdir $(ctangle) common comm-w2c cwebboot.c; \
- elif [ -r cwebboot.c ]; then \
- touch cwebboot.c; \
- else \
- cp $(srcdir)/cwebboot.c .; \
- fi
-DISTCLEANFILES += stamp-ctangle
+$(ctangleboot_OBJECTS): cwebboot.h
+# ctangleboot.cin and cwebboot.[ch]in are in the distribution
+ctangleboot.c cwebboot.c cwebboot.h:
+ cp -f $(srcdir)/$@in $@
+ctangleboot_DEPENDENCIES = $(default_dependencies)
+EXTRA_DIST += ctangleboot.cin cwebboot.cin cwebboot.hin
+DISTCLEANFILES += ctangleboot.c cwebboot.c cwebboot.h
## Tests
##