| 1 |
## $Id: bootstrap.am 61575 2022-01-11 22:47:10Z karl $ |
| 2 |
## texk/web2c/am/bootstrap.am: Makefile fragment for tangle and ctangle. |
| 3 |
## |
| 4 |
## Copyright 2015-2022 Karl Berry <[email protected]> |
| 5 |
## Copyright 2009-2015 Peter Breitenlohner <[email protected]> |
| 6 |
## You may freely use, modify and/or distribute this file. |
| 7 |
|
| 8 |
cp_silent = $(cp_silent_@AM_V@) |
| 9 |
cp_silent_ = $(cp_silent_@AM_DEFAULT_V@) |
| 10 |
cp_silent_0 = @echo " COPY " $@; |
| 11 |
cp_silent_1 = |
| 12 |
|
| 13 |
# Bootstrapping tangle requires making it with itself. We use the opportunity |
| 14 |
# to create an up-to-date tangleboot.pin as well. |
| 15 |
bin_PROGRAMS += tangle |
| 16 |
nodist_tangle_SOURCES = tangle.c tangle.h |
| 17 |
tangle.c tangle.h: tangle-web2c |
| 18 |
$(web2c) tangle |
| 19 |
tangle-web2c: tangle.p $(web2c_depend) |
| 20 |
$(web2c) tangle |
| 21 |
# tangle.p is a special case, since it is needed to compile itself. We |
| 22 |
# convert and compile the (distributed) tangleboot.pin to make a tangle |
| 23 |
# which we use to make the other programs. We depend on tangleboot, even |
| 24 |
# though we might not use it. |
| 25 |
tangle.p: tangleboot$(EXEEXT) tangle.web tangle.ch |
| 26 |
$(tangleboot) tangle tangle |
| 27 |
cmp -s tangle.p $(srcdir)/tangleboot.pin || { \ |
| 28 |
if $(AM_V_P); then \ |
| 29 |
echo "Updating tangle.p => $(srcdir)/tangleboot.pin"; \ |
| 30 |
else \ |
| 31 |
echo " UPD " tangleboot.pin; \ |
| 32 |
fi; cp -f tangle.p $(srcdir)/tangleboot.pin; } |
| 33 |
tangle.web: |
| 34 |
@echo "You seem to be missing tangle.web, goodbye." >&2 |
| 35 |
false |
| 36 |
EXTRA_DIST += tangle.web tangle.ch |
| 37 |
DISTCLEANFILES += tangle.c tangle.h tangle.p tangle-web2c |
| 38 |
|
| 39 |
noinst_PROGRAMS += tangleboot |
| 40 |
nodist_tangleboot_SOURCES = tangleboot.c tangleboot.h |
| 41 |
tangleboot.c tangleboot.h: tangleboot-web2c |
| 42 |
$(web2c) tangleboot |
| 43 |
tangleboot-web2c: tangleboot.p $(web2c_depend) |
| 44 |
$(web2c) tangleboot |
| 45 |
# tangleboot.pin is in the distribution |
| 46 |
.pin.p: |
| 47 |
$(cp_silent)cp -f $< $@ |
| 48 |
$(tangleboot_OBJECTS): $(tangleboot_DEPENDENCIES) |
| 49 |
tangleboot_DEPENDENCIES = $(default_dependencies) |
| 50 |
EXTRA_DIST += tangleboot.pin |
| 51 |
DISTCLEANFILES += tangleboot.c tangleboot.h tangleboot.p tangleboot-web2c |
| 52 |
|
| 53 |
# Bootstrapping ctangle requires making it with itself. We use the opportunity |
| 54 |
# to create an up-to-date ctangleboot.cin and cwebboot.cin as well. |
| 55 |
bin_PROGRAMS += ctangle |
| 56 |
nodist_ctangle_SOURCES = ctangle.c cweb.c |
| 57 |
# |
| 58 |
# ctangle.c and cweb.c are special cases, since they are needed to compile |
| 59 |
# themselves. We depend on ctangleboot, even though we might not use it. |
| 60 |
ctangleboot = AM_V_P=$(AM_V_P) $(SHELL) ./ctangleboot-sh $@ |
| 61 |
# |
| 62 |
ctangle.c: $(common_ctangle) cwebdir/ctangle.w cwebdir/ctang-w2c.ch |
| 63 |
$(ctangleboot) ctangle ctang-w2c.ch |
| 64 |
# |
| 65 |
cweb.c: $(common_ctangle) cwebdir/common.w cwebdir/comm-w2c.ch |
| 66 |
$(ctangleboot) common comm-w2c.ch cweb.c |
| 67 |
# |
| 68 |
common_ctangle = ctangleboot$(EXEEXT) cwebdir/comm-w2c.h ctangleboot-sh |
| 69 |
|
| 70 |
EXTRA_DIST += cwebdir |
| 71 |
NEVER_DIST += cwebdir/cweave.log cwebdir/cweave.trs |
| 72 |
NEVER_DIST += cwebdir/ctwill.log cwebdir/ctwill.trs |
| 73 |
NEVER_DIST += cwebdir/refsort.log cwebdir/refsort.trs |
| 74 |
NEVER_DIST += cwebdir/twinx.log cwebdir/twinx.trs |
| 75 |
## We install man/cweb.man, not cwebdir/cweb.1 |
| 76 |
## nodist_man_MANS += cwebdir/cweb.1 |
| 77 |
DISTCLEANFILES += ctangle.c cweb.c common-ctangle |
| 78 |
|
| 79 |
noinst_PROGRAMS += ctangleboot |
| 80 |
nodist_ctangleboot_SOURCES = ctangleboot.c cwebboot.c |
| 81 |
$(ctangleboot_OBJECTS): $(ctangleboot_DEPENDENCIES) |
| 82 |
# ctangleboot.cin and cwebboot.cin are in the distribution |
| 83 |
.cin.c: |
| 84 |
$(cp_silent)cp -f $< $@ |
| 85 |
.hin.h: |
| 86 |
$(cp_silent)cp -f $< $@ |
| 87 |
ctangleboot_DEPENDENCIES = $(default_dependencies) |
| 88 |
EXTRA_DIST += ctangleboot.cin cwebboot.cin |
| 89 |
DISTCLEANFILES += ctangleboot.c cwebboot.c |
| 90 |
|
| 91 |
## Tests |
| 92 |
## |
| 93 |
EXTRA_DIST += tangle.test |
| 94 |
|
| 95 |
TESTS += tangle.test |
| 96 |
tangle.log: tangle$(EXEEXT) |
| 97 |
|
| 98 |
DISTCLEANFILES += cftest.p |
| 99 |
|
| 100 |
# (end of bootstrap.am) |