summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/plain/pwebmac/makeall
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/plain/pwebmac/makeall')
-rw-r--r--Master/texmf-dist/doc/plain/pwebmac/makeall136
1 files changed, 83 insertions, 53 deletions
diff --git a/Master/texmf-dist/doc/plain/pwebmac/makeall b/Master/texmf-dist/doc/plain/pwebmac/makeall
index 879ec912d43..2a058c5c6f4 100644
--- a/Master/texmf-dist/doc/plain/pwebmac/makeall
+++ b/Master/texmf-dist/doc/plain/pwebmac/makeall
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
PROG=$(basename $0)
@@ -8,8 +8,8 @@ usage ()
Usage: $PROG [options]
Test driver for 'pwebmac.tex' in combination with various TeX engines.
-Produce TeX output in DVI or PDF from a set of C/WEB programs included
-in the 'TeX Live' source tree.
+Produce TeX output in DVI, PDF or HINT format from a set of C/WEB programs
+included in the 'TeX Live' source tree.
Options are (--long options only with GNU getopt):
-c, --changes Apply change file to C/WEB source
@@ -18,7 +18,7 @@ Options are (--long options only with GNU getopt):
-n, --new Use 'pwebmac' instead of 'webmac'
-o, --outdir ARG Create tarballs in path ARG
-p, --pdftocfront Place TOC page at the front (PDF only)
- -t, --tex ARG Use TeX variant ARG={tex,pdftex,xetex}
+ -t, --tex ARG Use TeX variant ARG={tex,{hi,pdf,xe}tex}
Public domain. Originally written by Andreas Scherer, 2020.
HELP
@@ -32,7 +32,7 @@ FILESELECT=false # user-defined '--files' selection
NEW=false # '\input pwebmac' instead of '\input webmac' for PDF et al.
OUTDIR=. # path where the resulting tarballs are placed
PDFTOCFRONT=false # push table-of-contents to front of PDF output
-TEX=tex # or 'pdftex' or 'xetex'
+TEX=tex # or 'pdftex' or 'xetex' or 'hitex'
# Initial list of C/WEB sources to process, overridable with option '-f':
KNUTHWHERE=$(locate /bibtex.web)
@@ -41,7 +41,7 @@ then echo "$PROG: Can't locate the TeX Live source tree!" >&2; exit 1
fi
KNUTHWARE=$(dirname $KNUTHWHERE)
-FILES="$KNUTHWARE/*.web pdftex.web xetex.web"
+FILES="$KNUTHWARE/*.web pdftex.web xetex.web twill"
WEBINPUTS=$KNUTHWARE//:
FILES="$FILES common ctangle cweave ctwill refsort twinx ctie tie"
@@ -87,6 +87,15 @@ CWEAVE="cweave -f +lX"
CTWILL="ctwill -f +lpdf"
PAX="pax -wvzf"
SED_I="sed -i" # non-GNU-sed requires an extra '' argument for '-i' option.
+PDF=pdf
+
+# HINT format
+if [ hitex = $TEX ]
+then
+ $TEX -ini -jobname=hitex tex.ini
+ TEX="hitex --compress"
+ PDF=hnt
+fi
# WEB and CWEB programs we want to get formatted
for f in $FILES
@@ -101,6 +110,11 @@ do
$CTWILL $f # prime the pump
$CTWILL $f # get decent answers
+ elif [ twill = $f ]
+ then
+ tie -m $f.web weave.web weave.ch weav-$f.ch
+ weave $f
+
elif [ glue = $f ]
then
weave $f # no 'glue.ch' at this time
@@ -121,6 +135,9 @@ do
WEBINPUTS=$KNUTHWARE/../../Work//:$WEBINPUTS: \
weave $f $f-final ;;
+ # TWILL is a change in and of itself
+ twill ) ;;
+
# all other WEB codes have singular changefiles
* ) weave $f $f ;;
esac
@@ -157,7 +174,7 @@ do
$SED_I -e "s/\(\\\\def\\\\title\)/\\\\datecontentspage\n\1/" $f.tex ;;
mf | tex | pdftex | xetex )
- $SED_I -e "s/\(\\\\def\\\\botofcontents\)/\\\\datethis\n\\\\emergencystretch=.1\\\\hsize\1/" $f.tex
+ $SED_I -e "s/\(\\\\def\\\\topofcontents\)/\\\\datethis\n\\\\emergencystretch=.1\\\\hsize\n\1/" $f.tex
# amend '\N' redefinition for PDF outlines in
# Metafont and TeX (also pdfTeX and XeTeX)
@@ -214,7 +231,7 @@ FI
# FIX: pdfTeX uses '\pdfTeX' in section names; these should
# appear correctly in the bookmarks, too.
pdftex )
- if $NEW && [ tex != $TEX ]
+ if $NEW && [ tex != "$TEX" ] && [[ ! $TEX =~ hitex ]]
then
$SED_I -e "s/\(\\\\def\\\\pdfTeX{pdf\\\\TeX}\)/\1 \\\\sanitizecommand\\\\pdfTeX{pdfTeX}\\\\sanitizecommand\\\\eTeX{e-TeX}/" \
$f.tex
@@ -245,62 +262,72 @@ FI
# only XeTeX can process XETEX.WEB
if [ xetex = $f ]
then $f $f
- elif [ refsort = $f ]
- then $TEX -interaction nonstopmode $f
- else $TEX $f
- fi
-
- if [ ctwill = $f ]
+ elif [ ctwill = $f ]
then
+ if [[ $TEX =~ hitex ]]
+ then
+ CTWILLTEX=pdftex
+ else
+ CTWILLTEX="$TEX"
+ fi
+ $CTWILLTEX $f
# sort mini-indexes
ctwill-refsort < $f.ref > $f.sref
- $TEX $f
+ $CTWILLTEX $f
+ elif [ refsort = $f ]
+ then $TEX -interaction nonstopmode $f
+ else $TEX $f
fi
done
-if $PDFTOCFRONT && ! $FILESELECT
+if ( $PDFTOCFRONT || [[ $TEX =~ hitex ]] ) && ! $FILESELECT
then
# create tarballs w/o changes for publication
if $CHANGES
then
- for f in *.pdf
+ for f in *.$PDF
do
case $f in
- *-changes.pdf ) rm -f $f; continue ;;
+ *-changes.$PDF ) rm -f $f; continue ;;
esac
- mv $f $(basename $f .pdf)-changes.pdf
+ mv $f $(basename $f .$PDF)-changes.$PDF
done
+ if [[ $TEX =~ hitex ]]
+ then
+ rm -f xetex-changes.pdf
+ mv xetex.pdf xetex-changes.pdf
+ fi
$PAX "$OUTDIR/etc-changes.tar.gz" -s ,^,etc/, \
- vftovp-changes.pdf vptovf-changes.pdf
+ vftovp-changes.$PDF vptovf-changes.$PDF
$PAX "$OUTDIR/mf-changes.tar.gz" -s ,^,mf/, \
- mf-changes.pdf
+ mf-changes.$PDF
$PAX "$OUTDIR/mfware-changes.tar.gz" -s ,^,mfware/, \
- gftodvi-changes.pdf gftopk-changes.pdf \
- gftype-changes.pdf mft-changes.pdf
+ gftodvi-changes.$PDF gftopk-changes.$PDF \
+ gftype-changes.$PDF mft-changes.$PDF
$PAX "$OUTDIR/tex-changes.tar.gz" -s ,^,tex/, \
- tex-changes.pdf
+ tex-changes.$PDF
$PAX "$OUTDIR/texware-changes.tar.gz" -s ,^,texware/, \
- dvitype-changes.pdf pltotf-changes.pdf \
- pooltype-changes.pdf tftopl-changes.pdf
+ dvitype-changes.$PDF pltotf-changes.$PDF \
+ pooltype-changes.$PDF tftopl-changes.$PDF
$PAX "$OUTDIR/web-changes.tar.gz" -s ,^,web/, \
- tangle-changes.pdf weave-changes.pdf
+ tangle-changes.$PDF weave-changes.$PDF
$PAX "$OUTDIR/bibtex-changes.tar.gz" -s ,^,bibtex/, \
- bibtex-changes.pdf
+ bibtex-changes.$PDF
$PAX "$OUTDIR/other-changes.tar.gz" -s ,^,other/, \
- dvicopy-changes.pdf patgen-changes.pdf \
- pktogf-changes.pdf pktype-changes.pdf
+ dvicopy-changes.$PDF patgen-changes.$PDF \
+ pktogf-changes.$PDF pktype-changes.$PDF
$PAX "$OUTDIR/pdftex-changes.tar.gz" -s ,^,pdftex/, \
- pdftex-changes.pdf
+ pdftex-changes.$PDF
$PAX "$OUTDIR/xetex-changes.tar.gz" -s ,^,xetex/, \
xetex-changes.pdf
$PAX "$OUTDIR/ctie-changes.tar.gz" -s ,^,ctie/, \
- ctie-changes.pdf
+ ctie-changes.$PDF
$PAX "$OUTDIR/tie-changes.tar.gz" -s ,^,tie/, \
- tie-changes.pdf
+ tie-changes.$PDF
$PAX "$OUTDIR/cweb-changes.tar.gz" -s ,^,cweb/, \
- common-changes.pdf ctangle-changes.pdf \
- cweave-changes.pdf refsort-changes.pdf \
- twinx-changes.pdf
+ common-changes.$PDF ctangle-changes.$PDF \
+ cweave-changes.$PDF refsort-changes.$PDF \
+ twinx-changes.$PDF
else
# Finally, build the remaining documents
# * TeX and Metafont test routines
@@ -336,45 +363,48 @@ then
eleven twelve
do
$TEX errata.$f
- mv errata.pdf errata.$f.pdf
+ mv errata.$PDF errata.$f.$PDF
done
$TEX errata
$PAX "$OUTDIR/errata.tar.gz" -s ,^,errata/, \
- errorlog.pdf errata.*.pdf errata.pdf
- $PAX "$OUTDIR/etc.tar.gz" -s ,^,etc/, vftovp.pdf vptovf.pdf
- $PAX "$OUTDIR/mf.tar.gz" -s ,^,mf/, mf.pdf trapman.pdf
+ errorlog.$PDF errata.*.$PDF errata.$PDF
+ $PAX "$OUTDIR/etc.tar.gz" -s ,^,etc/, vftovp.$PDF vptovf.$PDF
+ $PAX "$OUTDIR/mf.tar.gz" -s ,^,mf/, mf.$PDF trapman.$PDF
$PAX "$OUTDIR/mfware.tar.gz" -s ,^,mfware/, \
- gftodvi.pdf gftopk.pdf gftype.pdf mft.pdf
+ gftodvi.$PDF gftopk.$PDF gftype.$PDF mft.$PDF
$PAX "$OUTDIR/tex.tar.gz" -s ,^,tex/, \
- glue.pdf tex.pdf tripman.pdf
+ glue.$PDF tex.$PDF tripman.$PDF
$PAX "$OUTDIR/texware.tar.gz" -s ,^,texware/, \
- dvitype.pdf pltotf.pdf pooltype.pdf tftopl.pdf
+ dvitype.$PDF pltotf.$PDF pooltype.$PDF tftopl.$PDF
$PAX "$OUTDIR/web.tar.gz" -s ,^,web/, \
- webman.pdf tangle.pdf weave.pdf
- $PAX "$OUTDIR/bibtex.tar.gz" -s ,^,bibtex/, bibtex.pdf
+ webman.$PDF tangle.$PDF weave.$PDF twill.$PDF
+ $PAX "$OUTDIR/bibtex.tar.gz" -s ,^,bibtex/, bibtex.$PDF
$PAX "$OUTDIR/other.tar.gz" -s ,^,other/, \
- dvicopy.pdf patgen.pdf pktogf.pdf pktype.pdf
- $PAX "$OUTDIR/pdftex.tar.gz" -s ,^,pdftex/, pdftex.pdf
+ dvicopy.$PDF patgen.$PDF pktogf.$PDF pktype.$PDF
+ $PAX "$OUTDIR/pdftex.tar.gz" -s ,^,pdftex/, pdftex.$PDF
$PAX "$OUTDIR/xetex.tar.gz" -s ,^,xetex/, xetex.pdf
- $PAX "$OUTDIR/ctie.tar.gz" -s ,^,ctie/, ctie.pdf
- $PAX "$OUTDIR/tie.tar.gz" -s ,^,tie/, tie.pdf
+ $PAX "$OUTDIR/ctie.tar.gz" -s ,^,ctie/, ctie.$PDF
+ $PAX "$OUTDIR/tie.tar.gz" -s ,^,tie/, tie.$PDF
$PAX "$OUTDIR/cweb.tar.gz" -s ,^,cweb/, \
- cwebman.pdf common.pdf ctangle.pdf cweave.pdf \
- ctwill.pdf refsort.pdf twinx.pdf
+ cwebman.$PDF common.$PDF ctangle.$PDF cweave.$PDF \
+ ctwill.pdf refsort.$PDF twinx.$PDF
fi
# Notes to self:
# (1) Create a user-friendly central entrypoint with
# (a) pandoc index.md -o index.pdf
# (b) pandoc index.md -o index.tex;
- # pandoc index.tex -s -o index.html;
+ # pandoc index.tex -s -o index.html \
+ # --metadata title="C/WEB programs in TeX Live 2022";
# rm index.tex
# (2) Prepare a super-tarball from all the contents of these
- # individual tarballs (27/31) with either of
+ # individual tarballs (42/53 and 34/54) with either of
# (a) pax -wzf knuth-pdf.tar.gz knuth-pdf
+ # (a') pax -wzf knuth-hint.tar.gz knuth-hint
# (b) zip -r knuth-pdf.zip knuth-pdf
+ # (b') zip -r knuth-hint.zip knuth-hint
fi
exit 0