aboutsummaryrefslogtreecommitdiff
path: root/development/noweb
diff options
context:
space:
mode:
authorKyle Guinn <elyk03@gmail.com>2024-01-05 00:22:36 -0600
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-01-06 08:08:47 +0700
commite1596ea398fc1511466bd75aa2d5cafbc3ac1902 (patch)
tree8be1bdf95d3a2bed67e25d5ed396c0ca47437dc3 /development/noweb
parent733643e28827e406026e9f59cee5f37eac1945c2 (diff)
development/noweb: Updated for version 2.13
Signed-off-by: Kyle Guinn <elyk03@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/noweb')
-rw-r--r--development/noweb/noweb.SlackBuild26
-rw-r--r--development/noweb/noweb.info6
-rw-r--r--development/noweb/patches/make_cleanup.diff1578
-rw-r--r--development/noweb/patches/toascii.diff143
4 files changed, 217 insertions, 1536 deletions
diff --git a/development/noweb/noweb.SlackBuild b/development/noweb/noweb.SlackBuild
index 5282adcdebc0..a974ed2fd8b5 100644
--- a/development/noweb/noweb.SlackBuild
+++ b/development/noweb/noweb.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for noweb
-# Copyright 2010-2021 Kyle Guinn <elyk03@gmail.com>
+# Copyright 2010-2024 Kyle Guinn <elyk03@gmail.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,7 +25,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=noweb
-VERSION=${VERSION:-2.12}
+VERSION=${VERSION:-2.13}
SRCVER=$(echo $VERSION | tr . _)
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -39,9 +39,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -80,8 +77,6 @@ chmod -R u+w,go-w,a+rX-st .
# Adds PREFIX and DESTDIR support along with various other simplifications
patch -p1 < $CWD/patches/make_cleanup.diff
-# Needed to bootstrap
-patch -p1 < $CWD/patches/toascii.diff
# Postpone texhash until doinst.sh
sed -i 's/texhash/true/g' src/Makefile
@@ -89,6 +84,23 @@ sed -i 's/texhash/true/g' src/Makefile
# Does something like s/nawk/awk/ on several scripts
(cd src && ./awkname awk)
+# Fix timestamps. The general problem is that noweb's sources (and even
+# a Makefile) are written in noweb syntax and need to be "tangled" (code
+# chunks extracted to an ordinary source file) using notangle, requiring
+# a working version of noweb to already be installed. To bootstrap, the
+# tarball provides pre-tangled files that we must `touch` so that `make`
+# does not regenerate them. We assume the touched files are up-to-date,
+# which may not always be true. This script does not attempt rebuilding
+# the package to fix any such issues.
+#
+# First, prevent Makefile from regenerating itself before `make boot`.
+touch src/Makefile
+# Now `make boot` should touch the remaining files needed to bootstrap.
+# Beware, this may touch files not provided in the tarball (typically
+# documentation), creating empty files that will not be properly
+# generated later. Before version 2.13, this included the man pages.
+make -C src boot
+
make -j1 -C src all install \
ICONC="icont" \
LIBSRC="icon" \
diff --git a/development/noweb/noweb.info b/development/noweb/noweb.info
index eb65898c445f..5167063fefeb 100644
--- a/development/noweb/noweb.info
+++ b/development/noweb/noweb.info
@@ -1,8 +1,8 @@
PRGNAM="noweb"
-VERSION="2.12"
+VERSION="2.13"
HOMEPAGE="https://www.cs.tufts.edu/~nr/noweb/"
-DOWNLOAD="https://github.com/nrnrnr/noweb/archive/v2_12/noweb-2_12.tar.gz"
-MD5SUM="a1b27919429c70398251584bd03d94ab"
+DOWNLOAD="https://github.com/nrnrnr/noweb/archive/v2_13/noweb-2_13.tar.gz"
+MD5SUM="66cb386801305c64699cf4af73cb0eaf"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="icon"
diff --git a/development/noweb/patches/make_cleanup.diff b/development/noweb/patches/make_cleanup.diff
index 72c23f08e8db..157361d5e8d6 100644
--- a/development/noweb/patches/make_cleanup.diff
+++ b/development/noweb/patches/make_cleanup.diff
@@ -1,97 +1,19 @@
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -12,14 +12,16 @@
- all:
- @echo "You have no business running 'make' here; please look at the README file"
- @exit 1
--source: ; for i in src; do (cd $$i; make source); done
--www: ; for i in src/xdoc examples; do (cd $$i; make www); done
-+source:
-+ for i in src; do $(MAKE) -C $$i $@; done
-+www:
-+ for i in src/xdoc examples; do $(MAKE) -C $$i $@; done
-
- clean:
-- for i in src examples contrib; do (cd $$i; make clean); done
-- rm -f nwsrcfilter *~ */*~
-+ for i in src examples contrib; do $(MAKE) -C $$i $@; done
-+ $(RM) nwsrcfilter *~ */*~
- clobber: clean
-- for i in src examples contrib; do (cd $$i; make clobber); done
-+ for i in src examples contrib; do $(MAKE) -C $$i $@; done
-
- DATE:
- (./echo -n "Version $(VERSION) of "; date) > DATE
-@@ -39,21 +41,21 @@
- tarnames: clean source nwsrcfilter DATE
- find . -not -type d -not -name FAQ.old -print | ./nwsrcfilter
-
--tar: clean source nwsrcfilter DATE emacscheck
-+tar: clean source nwsrcfilter DATE emacscheck
- chmod +w src/Makefile
-- rm -rf /tmp/noweb-$(VERSION)
-- mkdir /tmp/noweb-$(VERSION)
-+ $(RM) -r /tmp/noweb-$(VERSION)
-+ mkdir -p /tmp/noweb-$(VERSION)
- tar cvf - `find . ! -type d -not -name FAQ.old -print | ./nwsrcfilter` | (cd /tmp/noweb-$(VERSION) ; tar xf - )
- (cd /tmp; tar cf - noweb-$(VERSION) ) | gzip -v > ../noweb-$(VERSION).tgz
-- rm -f ../noweb.tgz
-- (cd .. ; ln -s noweb-$(VERSION).tgz noweb.tgz)
-+ $(RM) ../noweb.tgz
-+ (cd .. && ln -s noweb-$(VERSION).tgz noweb.tgz)
- chmod -w src/Makefile
-
- ctan: clean source nwsrcfilter DATE emacscheck
- chmod +w src/Makefile
-- (cd src; make boot)
-- rm -f ../noweb-$(VERSION)-ctan.zip
-- find ./* ! -type d -not -name FAQ.old -not -name '.git*' -print | ./nwsrcfilter | sed 's@^@noweb/@' | ( ln -s . noweb; zip ../noweb-$(VERSION)-ctan.zip -@; rm -f noweb )
-+ $(MAKE) -C src boot
-+ $(RM) ../noweb-$(VERSION)-ctan.zip
-+ find ./* ! -type d -not -name FAQ.old -not -name '.git*' -print | ./nwsrcfilter | sed 's@^@noweb/@' | ( ln -s . noweb; zip ../noweb-$(VERSION)-ctan.zip -@; $(RM) noweb )
- chmod -w src/Makefile
-
- emacscheck:
-@@ -61,6 +63,4 @@
- diff src/elisp/noweb-mode.el $(HOME)/emacs/noweb-mode.el
-
- checkin:
-- (cd src; make "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin)
--
--
-+ $(MAKE) -C src "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" $@
diff --git a/contrib/Makefile b/contrib/Makefile
--- a/contrib/Makefile
+++ b/contrib/Makefile
-@@ -5,9 +5,12 @@
-
- # don't do kostas; it requires gnu make (ugh)
-
--all: ; for i in $(DIRS); do (cd $$i; make ICONC=$(ICONC) all); done
--install: ; for i in $(DIRS); do (cd $$i; make LIB=$(LIB) BIN=$(BIN) install); done
--source: ; for i in $(DIRS); do (cd $$i; make source); done
--clean: ; for i in $(DIRS); do (cd $$i; make clean); done
-+all:
-+ for i in $(DIRS); do $(MAKE) -C $$i ICONC=$(ICONC) $@; done
-+install:
-+ for i in $(DIRS); do $(MAKE) -C $$i LIB=$(LIB) BIN=$(BIN) $@; done
-+source:
-+ for i in $(DIRS); do $(MAKE) -C $$i $@; done
-+clean:
-+ for i in $(DIRS); do $(MAKE) -C $$i $@; done
- clobber: clean
--
+@@ -7,7 +7,7 @@
+ all:
+ for i in $(DIRS); do (cd $$i && $(MAKE) $@); done
+ install:
+- for i in $(DIRS); do (cd $$i && $(MAKE) LIB=$(LIB) $@); done
++ for i in $(DIRS); do (cd $$i && $(MAKE) LIB=$(LIB) BIN=$(BIN) $@); done
+ source:
+ for i in $(DIRS); do (cd $$i && $(MAKE) $@); done
+ clean:
diff --git a/contrib/conrado/Makefile b/contrib/conrado/Makefile
--- a/contrib/conrado/Makefile
+++ b/contrib/conrado/Makefile
-@@ -1,15 +1,16 @@
- LIB=/dev/null # to be overridden by install
-
- .SUFFIXES: .nw .icn
--.nw.icn: ; notangle -L'#line %-1L "%F"%N' $*.nw | cpif $*.icn
-+.nw.icn:
-+ notangle -L'#line %-1L "%F"%N' $< | cpif $@
+@@ -6,8 +6,8 @@
all: d2tex
source: d2tex
@@ -102,78 +24,32 @@ diff --git a/contrib/conrado/Makefile b/contrib/conrado/Makefile
# TeX files.
hospital.tex: hospital.nw d2tex
-- noweave -delay -filter ./d2tex hospital.nw > hospital.tex
-+ noweave -delay -filter ./d2tex $< > $@
- clean:
-- /bin/rm -f hospital.tex *.dvi *.aux *.log *.blg *.bbl *~
-+ $(RM) hospital.tex *.dvi *.aux *.log *.blg *.bbl *~
-diff --git a/contrib/davelove/Makefile b/contrib/davelove/Makefile
---- a/contrib/davelove/Makefile
-+++ b/contrib/davelove/Makefile
-@@ -3,4 +3,4 @@
- source:
- install:
- clean:
-- /bin/rm -f *.dvi *.log *.aux
-+ $(RM) *.dvi *.log *.aux
diff --git a/contrib/jobling/Makefile b/contrib/jobling/Makefile
--- a/contrib/jobling/Makefile
+++ b/contrib/jobling/Makefile
-@@ -1,15 +1,17 @@
-+BIN = /dev/null # to be overridden
-+LIB = /dev/null # to be overridden
- PROG = correct-refs
--DOCSRC = $(PROG).tex
--PROGSRC = $(PROG).csh
-+DOCSRC = $(PROG).tex
-+PROGSRC = $(PROG).csh
- SCRIPTS = list-anchors.awk awk-scripts.awk
-
--all: correct-refs.tex correct-refs.csh all-scripts
-+all: correct-refs.tex correct-refs.csh all-scripts
-
- correct-refs.tex: correct-refs.nw
- noweave -delay -index $< > $@
-
- correct-refs.csh: correct-refs.nw
-- notangle -Rcorrect-refs.csh $< | cpif $@
-+ notangle -R$@ $< | cpif $@
- chmod +x $@
+@@ -1,3 +1,5 @@
++BIN=/dev/null # to be overridden
++LIB=/dev/null # to be overridden
+ PROG=correct-refs
+ SCRIPTS=list-anchors.awk awk-scripts.awk
- all-scripts: correct-refs.nw
-@@ -17,18 +19,18 @@
- notangle -Rawk-scripts.awk $< | cpif awk-scripts.awk
- touch all-scripts
+@@ -17,8 +19,8 @@
+ notangle -R$@ correct-refs.nw | cpif $@
--install:
+ install: correct-refs.csh $(SCRIPTS)
- cp correct-refs.csh $(HOME)/bin
-- cp *.awk $(HOME)/lib
-+install: correct-refs.csh all-scripts
+- cp $(SCRIPTS) $(HOME)/lib
+ cp correct-refs.csh $(DESTDIR)$(BIN)
-+ cp *.awk $(DESTDIR)$(LIB)
++ cp $(SCRIPTS) $(DESTDIR)$(LIB)
tidy:
-- -rm *~ *% *.bak *.log *.blg
-+ $(RM) *~ *% *.bak *.log *.blg
-
- clean: tidy
-- -rm *.ps *.dvi *.toc *.aux *.bbl *.dep $(PROG).shar
-+ $(RM) *.ps *.dvi *.toc *.aux *.bbl *.dep $(PROG).shar
-
- realclean: clean
-- -rm $(DOCSRC) $(PROGSRC) $(SCRIPTS)
-+ $(RM) $(DOCSRC) $(PROGSRC) $(SCRIPTS)
-
- shar:
- shar README Makefile $(PROG).nw > $(PROG).shar
+ rm -f *~ *% *.bak *.log *.blg
diff --git a/contrib/jonkrom/Makefile b/contrib/jonkrom/Makefile
--- a/contrib/jonkrom/Makefile
+++ b/contrib/jonkrom/Makefile
-@@ -1,15 +1,15 @@
- LIB=/dev/null # override for installation
+@@ -2,8 +2,8 @@
SHELL=/bin/sh
all: noxref.krom
-- chmod +x noxref.krom
-install:
- cp noxref.krom $(LIB)
@@ -182,17 +58,9 @@ diff --git a/contrib/jonkrom/Makefile b/contrib/jonkrom/Makefile
source: noxref.krom
- noxref.krom: noxref.nw
-- notangle -Rnoxref noxref.nw > noxref.krom
-+ notangle -Rnoxref $< > $@
-+ chmod +x $@
-
- clean:
-- /bin/rm -f *.tex *.dvi *.ilg *.idx *.aux *.log *.blg *.bbl *~ *.ind noxref.krom
-+ $(RM) *.tex *.dvi *.ilg *.idx *.aux *.log *.blg *.bbl *~ *.ind noxref.krom
-diff --git a/contrib/kostas/Makefile.gnu b/contrib/kostas/Makefile.gnu
---- a/contrib/kostas/Makefile.gnu
-+++ b/contrib/kostas/Makefile.gnu
+diff --git a/contrib/kostas/Makefile b/contrib/kostas/Makefile
+--- a/contrib/kostas/Makefile
++++ b/contrib/kostas/Makefile
@@ -1,6 +1,6 @@
# Only works with Gnu make.
@@ -201,14 +69,9 @@ diff --git a/contrib/kostas/Makefile.gnu b/contrib/kostas/Makefile.gnu
ICONC=icont
# This is supposed to be the defns.nw file in the icon directory of the distribution.
defns=defns.nw
-@@ -10,36 +10,36 @@
- .SUFFIXES: .nw .icn .tex .dvi
-
-
--all: C.filter C++.filter icon.filter oot.filter math.filter\
-- autodefs.oot autodefs.math
-+all: C.filter C++.filter icon.filter oot.filter math.filter \
-+ autodefs.oot autodefs.math
+@@ -13,9 +13,9 @@
+ all: C.filter C++.filter icon.filter oot.filter math.filter \
+ autodefs.oot autodefs.math
-install:
- mv *.filter $(LIB)
@@ -219,219 +82,28 @@ diff --git a/contrib/kostas/Makefile.gnu b/contrib/kostas/Makefile.gnu
# TeX files.
--%.tex : %.nw
-+%.tex: %.nw
- $(WEAVE) $< > $@
- pp.tex: pp.nw
-- noweave -delay -autodefs icon -filter icon.filter -index pp.nw > pp.tex
--%.dvi : %.tex
-+ noweave -delay -autodefs icon -filter icon.filter -index $< > $@
-+%.dvi: %.tex
- latex $<
- # Don't delete the intermediate .tex file.
--.PRECIOUS : %.tex
-+.PRECIOUS: %.tex
-
-
- # Icon files.
--C.icn: pp.nw C_translation_table
-- $(TANGLE) -R"C" pp.nw > $@
--C++.icn: pp.nw C++_translation_table
-- $(TANGLE) -R"C++" pp.nw > $@
--icon.icn: pp.nw icon_translation_table
-- $(TANGLE) -R"Icon" pp.nw > $@
--oot.icn: pp.nw oot_translation_table
-- $(TANGLE) -R"OOT" pp.nw > $@
--math.icn: pp.nw math_translation_table
-- $(TANGLE) -R"Mathematica" pp.nw > $@
-+C.icn: pp.nw C_translation_table
-+ $(TANGLE) -R"C" $< > $@
-+C++.icn: pp.nw C++_translation_table
-+ $(TANGLE) -R"C++" $< > $@
-+icon.icn: pp.nw icon_translation_table
-+ $(TANGLE) -R"Icon" $< > $@
-+oot.icn: pp.nw oot_translation_table
-+ $(TANGLE) -R"OOT" $< > $@
-+math.icn: pp.nw math_translation_table
-+ $(TANGLE) -R"Mathematica" $< > $@
-
- ootdefs.icn: ootdefs.nw
- $(TANGLE) $< $(defns) > $@
-@@ -48,14 +48,14 @@
-
-
- # Executables: filters.
--%.filter : %.icn
-+%.filter: %.icn
- $(ICONC) -o $@ $<
-
- # Executables: autodefs.
- autodefs.oot: ootdefs.icn
-- $(ICONC) -o autodefs.oot ootdefs.icn
-+ $(ICONC) -o $@ $<
- autodefs.math: mathdefs.icn
-- $(ICONC) -o autodefs.math mathdefs.icn
-+ $(ICONC) -o $@ $<
-
-
- # Cleaning: remove all files that can be recreated from noweb sources.
-@@ -69,7 +69,4 @@
-
- # Also remove the Icon files for the filters.
- clean:
-- -rm -f $(rem) C.icn C++.icn icon.icn oot.icn math.icn *.filter autodefs.*
--
--
--
-+ $(RM) $(rem) C.icn C++.icn icon.icn oot.icn math.icn *.filter autodefs.*
-diff --git a/contrib/kostas/Makefile.make b/contrib/kostas/Makefile.make
---- a/contrib/kostas/Makefile.make
-+++ b/contrib/kostas/Makefile.make
-@@ -1,6 +1,6 @@
- # Only works with Gnu make.
-
--LIB=/opt/noweb/lib
-+LIB=/dev/null # to be overridden
- ICONC=icont
- # This is supposed to be the defns.nw file in the icon directory of the distribution.
- defns=defns.nw
-@@ -10,36 +10,36 @@
- .SUFFIXES: .nw .icn .tex .dvi
-
-
--all: C.filter C++.filter icon.filter oot.filter math.filter\
-- autodefs.oot autodefs.math
-+all: C.filter C++.filter icon.filter oot.filter math.filter \
-+ autodefs.oot autodefs.math
-
--install:
-- mv *.filter $(LIB)
-- mv autodefs.* $(LIB)
-+install: all
-+ cp *.filter $(DESTDIR)$(LIB)
-+ cp autodefs.* $(DESTDIR)$(LIB)
-
-
- # TeX files.
--%.tex : %.nw
-+%.tex: %.nw
- $(WEAVE) $< > $@
- pp.tex: pp.nw
-- noweave -delay -autodefs icon -filter icon.filter -index pp.nw > pp.tex
--%.dvi : %.tex
-+ noweave -delay -autodefs icon -filter icon.filter -index $< > $@
-+%.dvi: %.tex
- latex $<
- # Don't delete the intermediate .tex file.
--.PRECIOUS : %.tex
-+.PRECIOUS: %.tex
-
-
- # Icon files.
--C.icn: pp.nw C_translation_table
-- $(TANGLE) -R"C" pp.nw > $@
--C++.icn: pp.nw C++_translation_table
-- $(TANGLE) -R"C++" pp.nw > $@
--icon.icn: pp.nw icon_translation_table
-- $(TANGLE) -R"Icon" pp.nw > $@
--oot.icn: pp.nw oot_translation_table
-- $(TANGLE) -R"OOT" pp.nw > $@
--math.icn: pp.nw math_translation_table
-- $(TANGLE) -R"Mathematica" pp.nw > $@
-+C.icn: pp.nw C_translation_table
-+ $(TANGLE) -R"C" $< > $@
-+C++.icn: pp.nw C++_translation_table
-+ $(TANGLE) -R"C++" $< > $@
-+icon.icn: pp.nw icon_translation_table
-+ $(TANGLE) -R"Icon" $< > $@
-+oot.icn: pp.nw oot_translation_table
-+ $(TANGLE) -R"OOT" $< > $@
-+math.icn: pp.nw math_translation_table
-+ $(TANGLE) -R"Mathematica" $< > $@
-
- ootdefs.icn: ootdefs.nw
- $(TANGLE) $< $(defns) > $@
-@@ -48,14 +48,14 @@
-
-
- # Executables: filters.
--%.filter : %.icn
-+%.filter: %.icn
- $(ICONC) -o $@ $<
-
- # Executables: autodefs.
- autodefs.oot: ootdefs.icn
-- $(ICONC) -o autodefs.oot ootdefs.icn
-+ $(ICONC) -o $@ $<
- autodefs.math: mathdefs.icn
-- $(ICONC) -o autodefs.math mathdefs.icn
-+ $(ICONC) -o $@ $<
-
-
- # Cleaning: remove all files that can be recreated from noweb sources.
-@@ -69,7 +69,4 @@
-
- # Also remove the Icon files for the filters.
- clean:
-- -rm -f $(rem) C.icn C++.icn icon.icn oot.icn math.icn *.filter autodefs.*
--
--
--
-+ $(RM) $(rem) C.icn C++.icn icon.icn oot.icn math.icn *.filter autodefs.*
-diff --git a/contrib/leew/Makefile b/contrib/leew/Makefile
---- a/contrib/leew/Makefile
-+++ b/contrib/leew/Makefile
-@@ -3,4 +3,4 @@
- install:
- source:
- clean:
-- /bin/rm -f nocond *.dvi *.log *.aux *.toc *.tex *.tex nocond.1
-+ $(RM) nocond *.dvi *.log *.aux *.toc *.tex *.tex nocond.1
diff --git a/contrib/norman/Makefile b/contrib/norman/Makefile
--- a/contrib/norman/Makefile
+++ b/contrib/norman/Makefile
-@@ -1,10 +1,14 @@
- LIB=/dev/null # to be overridden
- DIRS=numarkup
-
--all: ; for i in $(DIRS); do (cd $$i; make ICONC=$(ICONC) ICONT=$(ICONT) all); done
--install: ; for i in $(DIRS); do (cd $$i; make LIB=$(LIB) BIN=$(BIN) install); done
--source: ; for i in $(DIRS); do (cd $$i; make source); done
--clean: ; for i in $(DIRS); do (cd $$i; make clean); done
-+all:
-+ for i in $(DIRS); do $(MAKE) -C $$i ICONC=$(ICONC) ICONT=$(ICONT) $@; done
-+install:
-+ for i in $(DIRS); do $(MAKE) -C $$i LIB=$(LIB) BIN=$(BIN) $@; done
-+source:
-+ for i in $(DIRS); do $(MAKE) -C $$i $@; done
-+clean:
-+ for i in $(DIRS); do $(MAKE) -C $$i $@; done
- iconlib: # cheap hack for slackmake
- true
-
+@@ -4,7 +4,7 @@
+ all:
+ for i in $(DIRS); do (cd $$i && $(MAKE) $@); done
+ install:
+- for i in $(DIRS); do (cd $$i && $(MAKE) LIB=$(LIB) $@); done
++ for i in $(DIRS); do (cd $$i && $(MAKE) LIB=$(LIB) BIN=$(BIN) $@); done
+ source:
+ for i in $(DIRS); do (cd $$i && $(MAKE) $@); done
+ clean:
diff --git a/contrib/norman/numarkup/Makefile b/contrib/norman/numarkup/Makefile
--- a/contrib/norman/numarkup/Makefile
+++ b/contrib/norman/numarkup/Makefile
-@@ -6,32 +6,31 @@
- OBJS = main.o pass1.o latex.o input.o scraps.o names.o arena.o global.o
-
- .SUFFIXES: .nw
--.nw.c: ; notangle -R"$@"'*' -L $< | cpif $@
--.nw.h: ; notangle -R"$@" $< | cpif $@
-+.nw.c:
-+ notangle -R"$@"'*' -L $< | cpif $@
-+.nw.h:
-+ notangle -R"$@" $< | cpif $@
-
--all:
-+all:
+@@ -15,11 +15,9 @@
noweb -t numarkup.nw
-- make $(TARGET)
-+ $(MAKE) $(TARGET)
+ $(MAKE) $(TARGET)
-install:
- noweb -t numarkup.nw
-- make $(TARGET)
+- $(MAKE) $(TARGET)
+install: all
strip $(TARGET)
- cp $(TARGET) $(LIB)
@@ -439,212 +111,19 @@ diff --git a/contrib/norman/numarkup/Makefile b/contrib/norman/numarkup/Makefile
source: main.c pass1.c latex.c input.c scraps.c names.c arena.c global.c
- clean:
-- rm -f *.o *.c *.h *.tex *.log *.dvi *~ *.blg $(TARGET) *.html *~
-+ $(RM) *.o *.c *.h *.tex *.log *.dvi *~ *.blg $(TARGET) *.html *~
-
- $(OBJS): global.h
-
- $(TARGET): $(OBJS)
-- $(CC) -o $(TARGET) $(OBJS)
-+ $(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
-
- numarkup.html: numarkup.nw
-- noweave -filter l2h -html -index numarkup.nw > numarkup.html
-+ noweave -filter l2h -html -index $< > $@
-
- numarkup.tex: numarkup.nw
-- noweb -o numarkup.nw
--
-+ noweb -o $@
diff --git a/contrib/ydirson/Makefile b/contrib/ydirson/Makefile
--- a/contrib/ydirson/Makefile
+++ b/contrib/ydirson/Makefile
-@@ -1,6 +1,6 @@
--LIB=/dev/null # to be overridden
-+LIB=/dev/null # to be overridden
-
--FILTERS = guesslang inheritlang enscript-html
-+FILTERS = guesslang inheritlang enscript-html
-
- # nothing to tangle or weave
- all:
@@ -8,4 +8,4 @@
clean:
install:
- cp -p $(FILTERS) $(LIB)
+ cp -p $(FILTERS) $(DESTDIR)$(LIB)
-diff --git a/examples/Makefile b/examples/Makefile
---- a/examples/Makefile
-+++ b/examples/Makefile
-@@ -4,14 +4,19 @@
- NOWEAVE=noweave
-
- .SUFFIXES: .i3 .m3 .nw .tex .dvi .html
--.nw.html: ; $(NOWEAVE) -filter l2h -filter btdefn -index -html $*.nw > $*.html
--.nw.tex: ; $(NOWEAVE) -index -filter btdefn $*.nw > $*.tex
--.nw.i3: ; $(NOTANGLE) -Rinterface -L'<* LINE %L "%F" *>%N' $*.nw > $*.i3
--.nw.m3: ; $(NOTANGLE) -L'<* LINE %L "%F" *>%N' $*.nw > $*.m3
--.tex.dvi: ; latex '\scrollmode \input '"$*"; while grep -s 'Rerun to get cross-references right' $*.log; do latex '\scrollmode \input '"$*"; done
-+.nw.html:
-+ $(NOWEAVE) -filter l2h -filter btdefn -index -html $< > $@
-+.nw.tex:
-+ $(NOWEAVE) -index -filter btdefn $< > $@
-+.nw.i3:
-+ $(NOTANGLE) -Rinterface -L'<* LINE %L "%F" *>%N' $< > $@
-+.nw.m3:
-+ $(NOTANGLE) -L'<* LINE %L "%F" *>%N' $< > $@
-+.tex.dvi:
-+ latex '\scrollmode \input '"$*"; while grep -s 'Rerun to get cross-references right' $*.log; do latex '\scrollmode \input '"$*"; done
-
- HTML=breakmodel.html compress.html dag.html graphs.html mipscoder.html primes.html \
-- scanner.html test.html tree.html wc.html wcni.html
-+ scanner.html test.html tree.html wc.html wcni.html
-
-
- www: $(HTML)
-@@ -19,37 +24,37 @@
- copy -v README.h $(WWW)/index.html
-
- clean:
-- rm -f *~ *.aux *.tex *.dvi *.log *.html *.toc
-+ $(RM) *~ *.aux *.tex *.dvi *.log *.html *.toc
-
- clobber: clean
-
- compress.html: compress.nw
-- $(NOWEAVE) -filter l2h -index -autodefs c -html compress.nw > compress.html
-+ $(NOWEAVE) -filter l2h -index -autodefs c -html $< > $@
- compress.tex: compress.nw
-- $(NOWEAVE) -index -autodefs c compress.nw > compress.tex
-+ $(NOWEAVE) -index -autodefs c $< > $@
- dag.html: dag.nw
-- $(NOWEAVE) -filter l2h -index -autodefs icon -html dag.nw > dag.html
-+ $(NOWEAVE) -filter l2h -index -autodefs icon -html $< > $@
- dag.tex: dag.nw
-- $(NOWEAVE) -index -autodefs icon dag.nw > dag.tex
-+ $(NOWEAVE) -index -autodefs icon $< > $@
- mipscoder.html: mipscoder.nw
-- $(NOWEAVE) -filter l2h -index -autodefs sml -html mipscoder.nw > mipscoder.html
-+ $(NOWEAVE) -filter l2h -index -autodefs sml -html $< > $@
- mipscoder.tex: mipscoder.nw
-- $(NOWEAVE) -autodefs sml -index mipscoder.nw > mipscoder.tex
-+ $(NOWEAVE) -autodefs sml -index $< > $@
- scanner.html: scanner.nw
-- $(NOWEAVE) -filter l2h -index -autodefs c -autodefs yacc -html scanner.nw > scanner.html
-+ $(NOWEAVE) -filter l2h -index -autodefs c -autodefs yacc -html $< > $@
- scanner.tex: scanner.nw
-- $(NOWEAVE) -index -autodefs c -autodefs yacc scanner.nw > scanner.tex
-+ $(NOWEAVE) -index -autodefs c -autodefs yacc $< > $@
- tree.html: tree.nw
-- $(NOWEAVE) -filter l2h -index -autodefs icon -html tree.nw > tree.html
-+ $(NOWEAVE) -filter l2h -index -autodefs icon -html $< > $@
- tree.tex: tree.nw
-- $(NOWEAVE) -index -autodefs icon tree.nw > tree.tex
-+ $(NOWEAVE) -index -autodefs icon $< > $@
- test.html: test.nw
-- $(NOWEAVE) -filter l2h -html test.nw > test.html
-+ $(NOWEAVE) -filter l2h -html $< > $@
- test.tex: test.nw
-- $(NOWEAVE) test.nw > test.tex
-+ $(NOWEAVE) $< > $@
- wc.html: wc.nw2html
-- $(NOWEAVE) -autodefs c -filter btdefn -index -html -n wc.nw2html > wc.html
-+ $(NOWEAVE) -autodefs c -filter btdefn -index -html -n $< > $@
- wcni.html: wc.nw2html
-- $(NOWEAVE) -filter btdefn -x -html -n wc.nw2html > wcni.html
-+ $(NOWEAVE) -filter btdefn -x -html -n $< > $@
- wc.tex: wc.nw
-- $(NOWEAVE) -autodefs c -filter btdefn -index wc.nw > wc.tex
-+ $(NOWEAVE) -autodefs c -filter btdefn -index $< > $@
-diff --git a/examples/Makefile.awk b/examples/Makefile.awk
---- a/examples/Makefile.awk
-+++ b/examples/Makefile.awk
-@@ -4,14 +4,19 @@
- NOWEAVE=noweave
-
- .SUFFIXES: .i3 .m3 .nw .tex .dvi .html
--.nw.html: ; $(NOWEAVE) -filter btdefn -index -html $*.nw > $*.html
--.nw.tex: ; $(NOWEAVE) -index -filter btdefn $*.nw > $*.tex
--.nw.i3: ; $(NOTANGLE) -Rinterface -L'<* LINE %L "%F" *>%N' $*.nw > $*.i3
--.nw.m3: ; $(NOTANGLE) -L'<* LINE %L "%F" *>%N' $*.nw > $*.m3
--.tex.dvi: ; latex '\scrollmode \input '"$*"; while grep -s 'Rerun to get cross-references right' $*.log; do latex '\scrollmode \input '"$*"; done
-+.nw.html:
-+ $(NOWEAVE) -filter btdefn -index -html $< > $@
-+.nw.tex:
-+ $(NOWEAVE) -index -filter btdefn $< > $@
-+.nw.i3:
-+ $(NOTANGLE) -Rinterface -L'<* LINE %L "%F" *>%N' $< > $@
-+.nw.m3:
-+ $(NOTANGLE) -L'<* LINE %L "%F" *>%N' $< > $@
-+.tex.dvi:
-+ latex '\scrollmode \input '"$*"; while grep -s 'Rerun to get cross-references right' $*.log; do latex '\scrollmode \input '"$*"; done
-
- HTML=breakmodel.html compress.html dag.html graphs.html mipscoder.html primes.html \
-- scanner.html test.html tree.html wc.html wcni.html
-+ scanner.html test.html tree.html wc.html wcni.html
- DVI=compress.dvi dag.dvi mipscoder.dvi scanner.dvi tree.dvi test.dvi wc.dvi
-
-
-@@ -22,37 +27,37 @@
- copy -v README.h $(WWW)/index.html
-
- clean:
-- rm -f *~ *.aux *.tex *.dvi *.log *.html *.toc
-+ $(RM) *~ *.aux *.tex *.dvi *.log *.html *.toc
-
- clobber: clean
-
- compress.html: compress.nw
-- $(NOWEAVE) -index -html compress.nw > compress.html
-+ $(NOWEAVE) -index -html $< > $@
- compress.tex: compress.nw
-- $(NOWEAVE) -index compress.nw > compress.tex
-+ $(NOWEAVE) -index $< > $@
- dag.html: dag.nw
-- $(NOWEAVE) -index -html dag.nw > dag.html
-+ $(NOWEAVE) -index -html $< > $@
- dag.tex: dag.nw
-- $(NOWEAVE) -index dag.nw > dag.tex
-+ $(NOWEAVE) -index $< > $@
- mipscoder.html: mipscoder.nw
-- $(NOWEAVE) -index -html mipscoder.nw > mipscoder.html
-+ $(NOWEAVE) -index -html $< > $@
- mipscoder.tex: mipscoder.nw
-- $(NOWEAVE) -index mipscoder.nw > mipscoder.tex
-+ $(NOWEAVE) -index $< > $@
- scanner.html: scanner.nw
-- $(NOWEAVE) -index -html scanner.nw > scanner.html
-+ $(NOWEAVE) -index -html $< > $@
- scanner.tex: scanner.nw
-- $(NOWEAVE) -index scanner.nw > scanner.tex
-+ $(NOWEAVE) -index $< > $@
- tree.html: tree.nw
-- $(NOWEAVE) -index -html tree.nw > tree.html
-+ $(NOWEAVE) -index -html $< > $@
- tree.tex: tree.nw
-- $(NOWEAVE) -index tree.nw > tree.tex
-+ $(NOWEAVE) -index $< > $@
- test.html: test.nw
-- $(NOWEAVE) -html test.nw > test.html
-+ $(NOWEAVE) -html $< > $@
- test.tex: test.nw
-- $(NOWEAVE) test.nw > test.tex
-+ $(NOWEAVE) $< > $@
- wc.html: wc.nw2html
-- $(NOWEAVE) -filter btdefn -index -html -n wc.nw2html > wc.html
-+ $(NOWEAVE) -filter btdefn -index -html -n $< > $@
- wcni.html: wc.nw2html
-- $(NOWEAVE) -filter btdefn -x -html -n wc.nw2html > wcni.html
-+ $(NOWEAVE) -filter btdefn -x -html -n $< > $@
- wc.tex: wc.nw
-- $(NOWEAVE) -filter btdefn -index wc.nw > wc.tex
-+ $(NOWEAVE) -filter btdefn -index $< > $@
diff --git a/src/Makefile b/src/Makefile
--- a/src/Makefile
+++ b/src/Makefile
-@@ -18,16 +18,17 @@
+@@ -19,12 +19,13 @@
# MAN7EXT is the extension for the nowebstyle man page (usually 7)
# TEXINPUTS is the directory for TeX macro files
# ELISP is the directory for emacs lisp files, or /dev/null not to install
@@ -662,89 +141,67 @@ diff --git a/src/Makefile b/src/Makefile
ELISP=/dev/null
# change WEAVE if you want a different version of noweave to be installed
--WEAVE=noweave
-+WEAVE=noweave
-
- # Stop editing. No user-serviceable parts below.
- SHELL=/bin/sh
-@@ -37,186 +38,183 @@
+@@ -38,8 +39,6 @@
MAN7DIR=$(MAN)/man$(MAN7EXT)
CATDIR=$(MAN)/cat$(MANEXT)
CAT7DIR=$(MAN)/cat$(MAN7EXT)
-LIBNAME=$(LIB)
-TEXNAME=$(TEXINPUTS)
--all:
-- cd c; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" all
-- for i in shell lib xdoc tex; do (cd $$i; make all); done
-- cd $(LIBSRC); make "ICONT=$(ICONT)" "ICONC=$(ICONC)" all
-+all:
-+ $(MAKE) -C c "CC=$(CC)" "CFLAGS=$(CFLAGS)" $@
-+ for i in shell lib xdoc tex; do $(MAKE) -C $$i $@; done
-+ $(MAKE) -C $(LIBSRC) "ICONT=$(ICONT)" "ICONC=$(ICONC)" $@
-
- FAQ: FAQ.html
-- sleep 1; html2ascii FAQ.html > FAQ
-+ sleep 1; html2ascii $< > $@
-
- FAQ.html: $(HOME)/www/noweb/FAQ.html
-- rm -f FAQ.html
-- /bin/cp $(HOME)/www/noweb/FAQ.html FAQ.html
-- chmod -w FAQ.html
-+ $(RM) $@
-+ cp $< $@
-+ chmod -w $@
+ all:
+ (cd c && $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS)" $@)
+@@ -56,145 +55,144 @@
install: install-code install-man install-tex install-elisp
uninstall: uninstall-code uninstall-man uninstall-tex uninstall-elisp
-- -rmdir $(BIN) $(LIB) 2>/dev/null || true
-+ -rmdir $(DESTDIR)$(BIN) $(DESTDIR)$(LIB) 2>/dev/null || true
+- rmdir $(BIN) $(LIB) 2>/dev/null || true
++ rmdir $(DESTDIR)$(BIN) $(DESTDIR)$(LIB) 2>/dev/null || true
install-shell:
- mkdir -p $(BIN) $(LIB)
-- sed "s@|LIBDIR|@$(LIBNAME)@" shell/noweb > $(BIN)/noweb
+- sed "s@|LIBDIR|@$(LIBNAME)@;s@|GITVERSION|@$(GITVERSION)@" shell/noweb > $(BIN)/noweb
- chmod +x $(BIN)/noweb
-- sed "s@|LIBDIR|@$(LIBNAME)@" shell/notangle > $(BIN)/notangle
+- sed "s@|LIBDIR|@$(LIBNAME)@;s@|GITVERSION|@$(GITVERSION)@" shell/notangle > $(BIN)/notangle
- chmod +x $(BIN)/notangle
-- sed "s@|LIBDIR|@$(LIBNAME)@" shell/$(WEAVE) > $(BIN)/$(WEAVE)
+- sed "s@|LIBDIR|@$(LIBNAME)@;s@|GITVERSION|@$(GITVERSION)@" shell/$(WEAVE) > $(BIN)/$(WEAVE)
- chmod +x $(BIN)/$(WEAVE)
-- sed "s@|LIBDIR|@$(LIBNAME)@" shell/nountangle > $(BIN)/nountangle
+- sed "s@|LIBDIR|@$(LIBNAME)@;s@|GITVERSION|@$(GITVERSION)@" shell/nountangle > $(BIN)/nountangle
- chmod +x $(BIN)/nountangle
-- sed "s@|LIBDIR|@$(LIBNAME)@" shell/nodefs > $(BIN)/nodefs
+- sed "s@|LIBDIR|@$(LIBNAME)@;s@|GITVERSION|@$(GITVERSION)@" shell/nodefs > $(BIN)/nodefs
- chmod +x $(BIN)/nodefs
-- sed "s@|LIBDIR|@$(LIBNAME)@" shell/noroots > $(BIN)/noroots
+- sed "s@|LIBDIR|@$(LIBNAME)@;s@|GITVERSION|@$(GITVERSION)@" shell/noroots > $(BIN)/noroots
- chmod +x $(BIN)/noroots
-- sed "s@|LIBDIR|@$(LIBNAME)@" shell/nuweb2noweb > $(BIN)/nuweb2noweb
+- sed "s@|LIBDIR|@$(LIBNAME)@;s@|GITVERSION|@$(GITVERSION)@" shell/nuweb2noweb > $(BIN)/nuweb2noweb
- chmod +x $(BIN)/nuweb2noweb
-- sed "s@|LIBDIR|@$(LIBNAME)@" shell/cpif > $(BIN)/cpif
+- sed "s@|LIBDIR|@$(LIBNAME)@;s@|GITVERSION|@$(GITVERSION)@" shell/cpif > $(BIN)/cpif
- chmod +x $(BIN)/cpif
-- sed "s@|LIBDIR|@$(LIBNAME)@" shell/htmltoc > $(BIN)/htmltoc
+- sed "s@|LIBDIR|@$(LIBNAME)@;s@|GITVERSION|@$(GITVERSION)@" shell/htmltoc > $(BIN)/htmltoc
- chmod +x $(BIN)/htmltoc
-- sed "s@|LIBDIR|@$(LIBNAME)@" shell/noroff > $(BIN)/noroff
+- sed "s@|LIBDIR|@$(LIBNAME)@;s@|GITVERSION|@$(GITVERSION)@" shell/noroff > $(BIN)/noroff
- chmod +x $(BIN)/noroff
- sed "s@|LIBDIR|@$(LIBNAME)@" shell/toroff > $(LIB)/toroff
- chmod +x $(LIB)/toroff
- cp shell/tmac.w $(LIB)
+ mkdir -p $(DESTDIR)$(BIN) $(DESTDIR)$(LIB)
-+ sed "s@|LIBDIR|@$(LIB)@" shell/noweb > $(DESTDIR)$(BIN)/noweb
++ sed "s@|LIBDIR|@$(LIB)@;s@|GITVERSION|@$(GITVERSION)@" shell/noweb > $(DESTDIR)$(BIN)/noweb
+ chmod +x $(DESTDIR)$(BIN)/noweb
-+ sed "s@|LIBDIR|@$(LIB)@" shell/notangle > $(DESTDIR)$(BIN)/notangle
++ sed "s@|LIBDIR|@$(LIB)@;s@|GITVERSION|@$(GITVERSION)@" shell/notangle > $(DESTDIR)$(BIN)/notangle
+ chmod +x $(DESTDIR)$(BIN)/notangle
-+ sed "s@|LIBDIR|@$(LIB)@" shell/$(WEAVE) > $(DESTDIR)$(BIN)/$(WEAVE)
++ sed "s@|LIBDIR|@$(LIB)@;s@|GITVERSION|@$(GITVERSION)@" shell/$(WEAVE) > $(DESTDIR)$(BIN)/$(WEAVE)
+ chmod +x $(DESTDIR)$(BIN)/$(WEAVE)
-+ sed "s@|LIBDIR|@$(LIB)@" shell/nountangle > $(DESTDIR)$(BIN)/nountangle
++ sed "s@|LIBDIR|@$(LIB)@;s@|GITVERSION|@$(GITVERSION)@" shell/nountangle > $(DESTDIR)$(BIN)/nountangle
+ chmod +x $(DESTDIR)$(BIN)/nountangle
-+ sed "s@|LIBDIR|@$(LIB)@" shell/nodefs > $(DESTDIR)$(BIN)/nodefs
++ sed "s@|LIBDIR|@$(LIB)@;s@|GITVERSION|@$(GITVERSION)@" shell/nodefs > $(DESTDIR)$(BIN)/nodefs
+ chmod +x $(DESTDIR)$(BIN)/nodefs
-+ sed "s@|LIBDIR|@$(LIB)@" shell/noroots > $(DESTDIR)$(BIN)/noroots
++ sed "s@|LIBDIR|@$(LIB)@;s@|GITVERSION|@$(GITVERSION)@" shell/noroots > $(DESTDIR)$(BIN)/noroots
+ chmod +x $(DESTDIR)$(BIN)/noroots
-+ sed "s@|LIBDIR|@$(LIB)@" shell/nuweb2noweb > $(DESTDIR)$(BIN)/nuweb2noweb
++ sed "s@|LIBDIR|@$(LIB)@;s@|GITVERSION|@$(GITVERSION)@" shell/nuweb2noweb > $(DESTDIR)$(BIN)/nuweb2noweb
+ chmod +x $(DESTDIR)$(BIN)/nuweb2noweb
-+ sed "s@|LIBDIR|@$(LIB)@" shell/cpif > $(DESTDIR)$(BIN)/cpif
++ sed "s@|LIBDIR|@$(LIB)@;s@|GITVERSION|@$(GITVERSION)@" shell/cpif > $(DESTDIR)$(BIN)/cpif
+ chmod +x $(DESTDIR)$(BIN)/cpif
-+ sed "s@|LIBDIR|@$(LIB)@" shell/htmltoc > $(DESTDIR)$(BIN)/htmltoc
++ sed "s@|LIBDIR|@$(LIB)@;s@|GITVERSION|@$(GITVERSION)@" shell/htmltoc > $(DESTDIR)$(BIN)/htmltoc
+ chmod +x $(DESTDIR)$(BIN)/htmltoc
-+ sed "s@|LIBDIR|@$(LIB)@" shell/noroff > $(DESTDIR)$(BIN)/noroff
++ sed "s@|LIBDIR|@$(LIB)@;s@|GITVERSION|@$(GITVERSION)@" shell/noroff > $(DESTDIR)$(BIN)/noroff
+ chmod +x $(DESTDIR)$(BIN)/noroff
+ sed "s@|LIBDIR|@$(LIB)@" shell/toroff > $(DESTDIR)$(LIB)/toroff
+ chmod +x $(DESTDIR)$(LIB)/toroff
@@ -763,39 +220,35 @@ diff --git a/src/Makefile b/src/Makefile
- rm -f $(BIN)/noroff
- rm -f $(LIB)/toroff
- rm -f $(LIB)/tmac.w
-+ $(RM) $(DESTDIR)$(BIN)/noweb
-+ $(RM) $(DESTDIR)$(BIN)/notangle
-+ $(RM) $(DESTDIR)$(BIN)/$(WEAVE)
-+ $(RM) $(DESTDIR)$(BIN)/nountangle
-+ $(RM) $(DESTDIR)$(BIN)/nodefs
-+ $(RM) $(DESTDIR)$(BIN)/noroots
-+ $(RM) $(DESTDIR)$(BIN)/nuweb2noweb
-+ $(RM) $(DESTDIR)$(BIN)/cpif
-+ $(RM) $(DESTDIR)$(BIN)/htmltoc
-+ $(RM) $(DESTDIR)$(BIN)/noroff
-+ $(RM) $(DESTDIR)$(LIB)/toroff
-+ $(RM) $(DESTDIR)$(LIB)/tmac.w
++ rm -f $(DESTDIR)$(BIN)/noweb
++ rm -f $(DESTDIR)$(BIN)/notangle
++ rm -f $(DESTDIR)$(BIN)/$(WEAVE)
++ rm -f $(DESTDIR)$(BIN)/nountangle
++ rm -f $(DESTDIR)$(BIN)/nodefs
++ rm -f $(DESTDIR)$(BIN)/noroots
++ rm -f $(DESTDIR)$(BIN)/nuweb2noweb
++ rm -f $(DESTDIR)$(BIN)/cpif
++ rm -f $(DESTDIR)$(BIN)/htmltoc
++ rm -f $(DESTDIR)$(BIN)/noroff
++ rm -f $(DESTDIR)$(LIB)/toroff
++ rm -f $(DESTDIR)$(LIB)/tmac.w
install-code: install-shell
- mkdir -p $(BIN) $(LIB)
+ mkdir -p $(DESTDIR)$(BIN) $(DESTDIR)$(LIB)
strip c/nt c/markup c/mnt c/finduses c/nwmktemp
- cp c/nt c/markup c/mnt c/finduses c/nwmktemp $(LIB)
-- cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
-- cd lib; make LIB=$(LIB) install
+ cp c/nt c/markup c/mnt c/finduses c/nwmktemp $(DESTDIR)$(LIB)
-+ $(MAKE) -C $(LIBSRC) ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
-+ $(MAKE) -C lib LIB=$(LIB) install
+ (cd $(LIBSRC) && $(MAKE) "ICONT=$(ICONT)" "ICONC=$(ICONC)" LIB=$(LIB) BIN=$(BIN) install)
+ (cd lib && $(MAKE) LIB=$(LIB) install)
uninstall-code: uninstall-shell
-- rm -f $(LIB)/nt $(LIB)/markup $(LIB)/mnt $(LIB)/finduses
-- cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) uninstall
-- cd lib; make LIB=$(LIB) uninstall
-+ $(RM) $(DESTDIR)$(LIB)/nt $(DESTDIR)$(LIB)/markup $(DESTDIR)$(LIB)/mnt $(DESTDIR)$(LIB)/finduses $(DESTDIR)$(LIB)/nwmktemp
-+ $(MAKE) -C $(LIBSRC) ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) uninstall
-+ $(MAKE) -C lib LIB=$(LIB) uninstall
+- rm -f $(LIB)/nt $(LIB)/markup $(LIB)/mnt $(LIB)/finduses
++ rm -f $(DESTDIR)$(LIB)/nt $(DESTDIR)$(LIB)/markup $(DESTDIR)$(LIB)/mnt $(DESTDIR)$(LIB)/finduses $(DESTDIR)$(LIB)/nwmktemp
+ (cd $(LIBSRC) && $(MAKE) "ICONT=$(ICONT)" "ICONC=$(ICONC)" LIB=$(LIB) BIN=$(BIN) uninstall)
+ (cd lib && $(MAKE) LIB=$(LIB) uninstall)
install-man:
-- mkdir -p $(MAN) $(MANDIR) $(MAN7DIR)
+- mkdir -p $(MANDIR) $(MAN7DIR)
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.1 > $(MANDIR)/cpif.$(MANEXT)
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nodefs.1 > $(MANDIR)/nodefs.$(MANEXT)
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroots.1 > $(MANDIR)/noroots.$(MANEXT)
@@ -809,9 +262,9 @@ diff --git a/src/Makefile b/src/Makefile
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nowebstyle.7 > $(MAN7DIR)/nowebstyle.$(MAN7EXT)
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nowebfilters.7 > $(MAN7DIR)/nowebfilters.$(MAN7EXT)
- rm -f $(MANDIR)/noweave.$(MANEXT)
-- (cd $(MANDIR); ln notangle.$(MANEXT) noweave.$(MANEXT))
+- (cd $(MANDIR) && ln notangle.$(MANEXT) noweave.$(MANEXT))
- rm -f $(MANDIR)/nountangle.$(MANEXT)
-- (cd $(MANDIR); ln notangle.$(MANEXT) nountangle.$(MANEXT))
+- (cd $(MANDIR) && ln notangle.$(MANEXT) nountangle.$(MANEXT))
+ mkdir -p $(DESTDIR)$(MANDIR) $(DESTDIR)$(MAN7DIR)
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/cpif.1 > $(DESTDIR)$(MANDIR)/cpif.$(MANEXT)
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nodefs.1 > $(DESTDIR)$(MANDIR)/nodefs.$(MANEXT)
@@ -825,9 +278,9 @@ diff --git a/src/Makefile b/src/Makefile
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/htmltoc.1 > $(DESTDIR)$(MANDIR)/htmltoc.$(MANEXT)
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nowebstyle.7 > $(DESTDIR)$(MAN7DIR)/nowebstyle.$(MAN7EXT)
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nowebfilters.7 > $(DESTDIR)$(MAN7DIR)/nowebfilters.$(MAN7EXT)
-+ $(RM) $(DESTDIR)$(MANDIR)/noweave.$(MANEXT)
++ rm -f $(DESTDIR)$(MANDIR)/noweave.$(MANEXT)
+ (cd $(DESTDIR)$(MANDIR) && ln -s notangle.$(MANEXT) noweave.$(MANEXT))
-+ $(RM) $(DESTDIR)$(MANDIR)/nountangle.$(MANEXT)
++ rm -f $(DESTDIR)$(MANDIR)/nountangle.$(MANEXT)
+ (cd $(DESTDIR)$(MANDIR) && ln -s notangle.$(MANEXT) nountangle.$(MANEXT))
uninstall-man:
- rm -f $(MANDIR)/cpif.$(MANEXT)
@@ -844,24 +297,24 @@ diff --git a/src/Makefile b/src/Makefile
- rm -f $(MAN7DIR)/nowebfilters.$(MAN7EXT)
- rm -f $(MANDIR)/noweave.$(MANEXT)
- rm -f $(MANDIR)/nountangle.$(MANEXT)
-- -rmdir $(MANDIR) $(MAN7DIR) $(MAN) 2>/dev/null || true
-+ $(RM) $(DESTDIR)$(MANDIR)/cpif.$(MANEXT)
-+ $(RM) $(DESTDIR)$(MANDIR)/nodefs.$(MANEXT)
-+ $(RM) $(DESTDIR)$(MANDIR)/noroots.$(MANEXT)
-+ $(RM) $(DESTDIR)$(MANDIR)/noweb.$(MANEXT)
-+ $(RM) $(DESTDIR)$(MANDIR)/noindex.$(MANEXT)
-+ $(RM) $(DESTDIR)$(MANDIR)/nuweb2noweb.$(MANEXT)
-+ $(RM) $(DESTDIR)$(MANDIR)/notangle.$(MANEXT)
-+ $(RM) $(DESTDIR)$(MANDIR)/noroff.$(MANEXT)
-+ $(RM) $(DESTDIR)$(MANDIR)/sl2h.$(MANEXT)
-+ $(RM) $(DESTDIR)$(MANDIR)/htmltoc.$(MANEXT)
-+ $(RM) $(DESTDIR)$(MAN7DIR)/nowebstyle.$(MAN7EXT)
-+ $(RM) $(DESTDIR)$(MAN7DIR)/nowebfilters.$(MAN7EXT)
-+ $(RM) $(DESTDIR)$(MANDIR)/noweave.$(MANEXT)
-+ $(RM) $(DESTDIR)$(MANDIR)/nountangle.$(MANEXT)
-+ -rmdir $(DESTDIR)$(MANDIR) $(DESTDIR)$(MAN7DIR) $(DESTDIR)$(MAN) 2>/dev/null || true
+- rmdir $(MANDIR) $(MAN7DIR) $(MAN) 2>/dev/null || true
++ rm -f $(DESTDIR)$(MANDIR)/cpif.$(MANEXT)
++ rm -f $(DESTDIR)$(MANDIR)/nodefs.$(MANEXT)
++ rm -f $(DESTDIR)$(MANDIR)/noroots.$(MANEXT)
++ rm -f $(DESTDIR)$(MANDIR)/noweb.$(MANEXT)
++ rm -f $(DESTDIR)$(MANDIR)/noindex.$(MANEXT)
++ rm -f $(DESTDIR)$(MANDIR)/nuweb2noweb.$(MANEXT)
++ rm -f $(DESTDIR)$(MANDIR)/notangle.$(MANEXT)
++ rm -f $(DESTDIR)$(MANDIR)/noroff.$(MANEXT)
++ rm -f $(DESTDIR)$(MANDIR)/sl2h.$(MANEXT)
++ rm -f $(DESTDIR)$(MANDIR)/htmltoc.$(MANEXT)
++ rm -f $(DESTDIR)$(MAN7DIR)/nowebstyle.$(MAN7EXT)
++ rm -f $(DESTDIR)$(MAN7DIR)/nowebfilters.$(MAN7EXT)
++ rm -f $(DESTDIR)$(MANDIR)/noweave.$(MANEXT)
++ rm -f $(DESTDIR)$(MANDIR)/nountangle.$(MANEXT)
++ rmdir $(DESTDIR)$(MANDIR) $(DESTDIR)$(MAN7DIR) $(DESTDIR)$(MAN) 2>/dev/null || true
install-gzipped-man:
-- mkdir -p $(MAN) $(MANDIR) $(MAN7DIR)
+- mkdir -p $(MANDIR) $(MAN7DIR)
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.1 | gzip -9 > $(MANDIR)/cpif.$(MANEXT).gz
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nodefs.1 | gzip -9 > $(MANDIR)/nodefs.$(MANEXT).gz
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroots.1 | gzip -9 > $(MANDIR)/noroots.$(MANEXT).gz
@@ -875,9 +328,9 @@ diff --git a/src/Makefile b/src/Makefile
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nowebstyle.7 | gzip -9 > $(MAN7DIR)/nowebstyle.$(MAN7EXT).gz
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nowebfilters.7 | gzip -9 > $(MAN7DIR)/nowebfilters.$(MAN7EXT).gz
- rm -f $(MANDIR)/noweave.$(MANEXT).gz
-- (cd $(MANDIR); ln notangle.$(MANEXT).gz noweave.$(MANEXT).gz)
+- (cd $(MANDIR) && ln notangle.$(MANEXT).gz noweave.$(MANEXT).gz)
- rm -f $(MANDIR)/nountangle.$(MANEXT).gz
-- (cd $(MANDIR); ln notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
+- (cd $(MANDIR) && ln notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
+ mkdir -p $(DESTDIR)$(MANDIR) $(DESTDIR)$(MAN7DIR)
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/cpif.1 | gzip -9 > $(DESTDIR)$(MANDIR)/cpif.$(MANEXT).gz
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nodefs.1 | gzip -9 > $(DESTDIR)$(MANDIR)/nodefs.$(MANEXT).gz
@@ -891,13 +344,13 @@ diff --git a/src/Makefile b/src/Makefile
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/htmltoc.1 | gzip -9 > $(DESTDIR)$(MANDIR)/htmltoc.$(MANEXT).gz
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nowebstyle.7 | gzip -9 > $(DESTDIR)$(MAN7DIR)/nowebstyle.$(MAN7EXT).gz
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nowebfilters.7 | gzip -9 > $(DESTDIR)$(MAN7DIR)/nowebfilters.$(MAN7EXT).gz
-+ $(RM) $(DESTDIR)$(MANDIR)/noweave.$(MANEXT).gz
++ rm -f $(DESTDIR)$(MANDIR)/noweave.$(MANEXT).gz
+ (cd $(DESTDIR)$(MANDIR) && ln -s notangle.$(MANEXT).gz noweave.$(MANEXT).gz)
-+ $(RM) $(DESTDIR)$(MANDIR)/nountangle.$(MANEXT).gz
++ rm -f $(DESTDIR)$(MANDIR)/nountangle.$(MANEXT).gz
+ (cd $(DESTDIR)$(MANDIR) && ln -s notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
install-preformat-man:
-echo "Warning: install-preformat-man is obsolete, even on Slackware systems" 1>&2
-- mkdir -p $(MAN) $(CATDIR) $(CAT7DIR)
+- mkdir -p $(CATDIR) $(CAT7DIR)
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.txt | gzip > $(CATDIR)/cpif.$(MANEXT).gz
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nodefs.txt | gzip > $(CATDIR)/nodefs.$(MANEXT).gz
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/noroots.txt | gzip > $(CATDIR)/noroots.$(MANEXT).gz
@@ -911,9 +364,9 @@ diff --git a/src/Makefile b/src/Makefile
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nowebstyle.txt | gzip > $(CAT7DIR)/nowebstyle.$(MAN7EXT).gz
- sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/nowebfilters.txt | gzip > $(CAT7DIR)/nowebfilters.$(MAN7EXT).gz
- rm -f $(CATDIR)/noweave.$(MANEXT).gz
-- (cd $(CATDIR); ln notangle.$(MANEXT).gz noweave.$(MANEXT).gz)
+- (cd $(CATDIR) && ln notangle.$(MANEXT).gz noweave.$(MANEXT).gz)
- rm -f $(CATDIR)/nountangle.$(MANEXT).gz
-- (cd $(CATDIR); ln notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
+- (cd $(CATDIR) && ln notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
+ mkdir -p $(DESTDIR)$(CATDIR) $(DESTDIR)$(CAT7DIR)
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/cpif.txt | gzip > $(DESTDIR)$(CATDIR)/cpif.$(MANEXT).gz
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nodefs.txt | gzip > $(DESTDIR)$(CATDIR)/nodefs.$(MANEXT).gz
@@ -927,73 +380,39 @@ diff --git a/src/Makefile b/src/Makefile
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/htmltoc.txt | gzip > $(DESTDIR)$(CATDIR)/htmltoc.$(MANEXT).gz
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nowebstyle.txt | gzip > $(DESTDIR)$(CAT7DIR)/nowebstyle.$(MAN7EXT).gz
+ sed -e "s@|LIBDIR|@$(LIB)@" -e "s@|TEXINPUTS|@$(TEXINPUTS)@" xdoc/nowebfilters.txt | gzip > $(DESTDIR)$(CAT7DIR)/nowebfilters.$(MAN7EXT).gz
-+ $(RM) $(DESTDIR)$(CATDIR)/noweave.$(MANEXT).gz
++ rm -f $(DESTDIR)$(CATDIR)/noweave.$(MANEXT).gz
+ (cd $(DESTDIR)$(CATDIR) && ln -s notangle.$(MANEXT).gz noweave.$(MANEXT).gz)
-+ $(RM) $(DESTDIR)$(CATDIR)/nountangle.$(MANEXT).gz
++ rm -f $(DESTDIR)$(CATDIR)/nountangle.$(MANEXT).gz
+ (cd $(DESTDIR)$(CATDIR) && ln -s notangle.$(MANEXT).gz nountangle.$(MANEXT).gz)
install-tex:
- mkdir -p $(TEXINPUTS)
-- cp tex/nwmac.tex tex/noweb.sty $(TEXINPUTS)
+- sed "s@|GITVERSION|@$(GITVERSION)@" tex/nwmac.tex > $(TEXINPUTS)/nwmac.tex
+- sed "s@|GITVERSION|@$(GITVERSION)@" tex/noweb.sty > $(TEXINPUTS)/noweb.sty
+ mkdir -p $(DESTDIR)$(TEXINPUTS)
-+ cp tex/nwmac.tex tex/noweb.sty $(DESTDIR)$(TEXINPUTS)
++ sed "s@|GITVERSION|@$(GITVERSION)@" tex/nwmac.tex > $(DESTDIR)$(TEXINPUTS)/nwmac.tex
++ sed "s@|GITVERSION|@$(GITVERSION)@" tex/noweb.sty > $(DESTDIR)$(TEXINPUTS)/noweb.sty
-texhash || echo "Program texhash not found or failed"
uninstall-tex:
-- rm -f $(TEXINPUTS)/nwmac.tex $(TEXINPUTS)/noweb.sty || true
-+ $(RM) $(DESTDIR)$(TEXINPUTS)/nwmac.tex $(DESTDIR)$(TEXINPUTS)/noweb.sty || true
-
+- rm -f $(TEXINPUTS)/nwmac.tex
+- rm -f $(TEXINPUTS)/noweb.sty
++ rm -f $(DESTDIR)$(TEXINPUTS)/nwmac.tex
++ rm -f $(DESTDIR)$(TEXINPUTS)/noweb.sty
install-elisp:
- if [ "/dev/null" != "$(ELISP)" ]; then mkdir -p $(ELISP); fi
- cp elisp/noweb-mode.el $(ELISP)
+ if [ "/dev/null" != "$(ELISP)" ]; then mkdir -p $(DESTDIR)$(ELISP) && cp elisp/noweb-mode.el $(DESTDIR)$(ELISP); fi
uninstall-elisp:
-- rm -f $(ELISP)/noweb-mode.el || true
-+ if [ "/dev/null" != "$(ELISP)" ]; then $(RM) $(DESTDIR)$(ELISP)/noweb-mode.el; fi
- checkin:
-- for i in lib tex xdoc; do (cd $$i; make "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin); done
-- for i in c icon awk; do (cd $$i; ci -l $(CINAME) $(CIMSG) *.nw Makefile); done
-- (cd elisp; ci -l $(CINAME) $(CIMSG) *.el)
-+ for i in lib tex xdoc; do $(MAKE) -C $$i "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" $@; done
-+ for i in c icon awk; do (cd $$i && ci -l $(CINAME) $(CIMSG) *.nw Makefile); done
-+ (cd elisp && ci -l $(CINAME) $(CIMSG) *.el)
- ci -l $(CINAME) $(CIMSG) Makefile.nw INSTALL INSTALL.DOS README FAQ COPYRIGHT nwmake *.nw
-
+- rm -f $(ELISP)/noweb-mode.el
++ if [ "/dev/null" != "$(ELISP)" ]; then rm -f $(DESTDIR)$(ELISP)/noweb-mode.el; fi
source: FAQ
-- for i in c shell lib xdoc icon awk tex; do (cd $$i; make CPIF=">" source); done
-+ for i in c shell lib xdoc icon awk tex; do $(MAKE) -C $$i CPIF=">" $@; done
+ for i in c shell lib xdoc icon awk tex; do (cd $$i && $(MAKE) CPIF=">" $@); done
sleep 1
-- for i in c shell lib xdoc icon awk tex; do (cd $$i; make touch); done
-+ for i in c shell lib xdoc icon awk tex; do $(MAKE) -C $$i touch; done
- touch:
- touch FAQ
-- for i in c shell lib xdoc icon awk tex; do (cd $$i; make touch); done
-+ for i in c shell lib xdoc icon awk tex; do $(MAKE) -C $$i $@; done
- boot:
-- for i in c shell lib xdoc icon awk tex; do (cd $$i; make boot); done
-+ for i in c shell lib xdoc icon awk tex; do $(MAKE) -C $$i $@; done
- clean:
-- for i in c shell lib xdoc icon awk tex; do (cd $$i; make clean); done
-- rm -f nwsrcfilter *~ */*~
-+ for i in c shell lib xdoc icon awk tex; do $(MAKE) -C $$i $@; done
-+ $(RM) nwsrcfilter *~ */*~
-
- clobber: clean
-- for i in c shell lib xdoc icon awk tex; do (cd $$i; make clobber); done
-+ for i in c shell lib xdoc icon awk tex; do $(MAKE) -C $$i $@; done
-
- Makefile: Makefile.nw
-- chmod +w Makefile
-- notangle -R'script' Makefile.nw | sh > Makefile
-- chmod -w Makefile
-+ chmod +w $@
-+ notangle -R'script' $< | sh > $@
-+ chmod -w $@
-
diff --git a/src/Makefile.nw b/src/Makefile.nw
--- a/src/Makefile.nw
+++ b/src/Makefile.nw
-@@ -23,16 +23,17 @@
+@@ -24,12 +24,13 @@
# MAN7EXT is the extension for the nowebstyle man page (usually 7)
# TEXINPUTS is the directory for TeX macro files
# ELISP is the directory for emacs lisp files, or /dev/null not to install
@@ -1011,43 +430,21 @@ diff --git a/src/Makefile.nw b/src/Makefile.nw
ELISP=/dev/null
# change WEAVE if you want a different version of noweave to be installed
--WEAVE=noweave
-+WEAVE=noweave
-
- # Stop editing. No user-serviceable parts below.
- SHELL=/bin/sh
-@@ -42,46 +43,44 @@
+@@ -43,8 +44,6 @@
MAN7DIR=$(MAN)/man$(MAN7EXT)
CATDIR=$(MAN)/cat$(MANEXT)
CAT7DIR=$(MAN)/cat$(MAN7EXT)
-LIBNAME=$(LIB)
-TEXNAME=$(TEXINPUTS)
--all:
-- cd c; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" all
-- for i in shell lib xdoc tex; do (cd $$i; make all); done
-- cd $(LIBSRC); make "ICONT=$(ICONT)" "ICONC=$(ICONC)" all
-+all:
-+ $(MAKE) -C c "CC=$(CC)" "CFLAGS=$(CFLAGS)" $@
-+ for i in shell lib xdoc tex; do $(MAKE) -C $$i $@; done
-+ $(MAKE) -C $(LIBSRC) "ICONT=$(ICONT)" "ICONC=$(ICONC)" $@
-
- FAQ: FAQ.html
-- sleep 1; html2ascii FAQ.html > FAQ
-+ sleep 1; html2ascii $< > $@
-
- FAQ.html: $(HOME)/www/noweb/FAQ.html
-- rm -f FAQ.html
-- /bin/cp $(HOME)/www/noweb/FAQ.html FAQ.html
-- chmod -w FAQ.html
-+ $(RM) $@
-+ cp $< $@
-+ chmod -w $@
+ all:
+ (cd c && $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS)" $@)
+@@ -61,26 +60,26 @@
install: install-code install-man install-tex install-elisp
uninstall: uninstall-code uninstall-man uninstall-tex uninstall-elisp
-- -rmdir $(BIN) $(LIB) 2>/dev/null || true
-+ -rmdir $(DESTDIR)$(BIN) $(DESTDIR)$(LIB) 2>/dev/null || true
+- rmdir $(BIN) $(LIB) 2>/dev/null || true
++ rmdir $(DESTDIR)$(BIN) $(DESTDIR)$(LIB) 2>/dev/null || true
install-shell:
- mkdir -p $(BIN) $(LIB)
@@ -1059,40 +456,34 @@ diff --git a/src/Makefile.nw b/src/Makefile.nw
uninstall-shell:
<<uninstall shell binaries>>
- rm -f $(LIB)/tmac.w
-+ $(RM) $(DESTDIR)$(LIB)/tmac.w
++ rm -f $(DESTDIR)$(LIB)/tmac.w
install-code: install-shell
- mkdir -p $(BIN) $(LIB)
+ mkdir -p $(DESTDIR)$(BIN) $(DESTDIR)$(LIB)
strip c/nt c/markup c/mnt c/finduses c/nwmktemp
- cp c/nt c/markup c/mnt c/finduses c/nwmktemp $(LIB)
-- cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
-- cd lib; make LIB=$(LIB) install
+ cp c/nt c/markup c/mnt c/finduses c/nwmktemp $(DESTDIR)$(LIB)
-+ $(MAKE) -C $(LIBSRC) ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
-+ $(MAKE) -C lib LIB=$(LIB) install
+ (cd $(LIBSRC) && $(MAKE) "ICONT=$(ICONT)" "ICONC=$(ICONC)" LIB=$(LIB) BIN=$(BIN) install)
+ (cd lib && $(MAKE) LIB=$(LIB) install)
uninstall-code: uninstall-shell
-- rm -f $(LIB)/nt $(LIB)/markup $(LIB)/mnt $(LIB)/finduses
-- cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) uninstall
-- cd lib; make LIB=$(LIB) uninstall
-+ $(RM) $(DESTDIR)$(LIB)/nt $(DESTDIR)$(LIB)/markup $(DESTDIR)$(LIB)/mnt $(DESTDIR)$(LIB)/finduses $(DESTDIR)$(LIB)/nwmktemp
-+ $(MAKE) -C $(LIBSRC) ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) uninstall
-+ $(MAKE) -C lib LIB=$(LIB) uninstall
+- rm -f $(LIB)/nt $(LIB)/markup $(LIB)/mnt $(LIB)/finduses
++ rm -f $(DESTDIR)$(LIB)/nt $(DESTDIR)$(LIB)/markup $(DESTDIR)$(LIB)/mnt $(DESTDIR)$(LIB)/finduses $(DESTDIR)$(LIB)/nwmktemp
+ (cd $(LIBSRC) && $(MAKE) "ICONT=$(ICONT)" "ICONC=$(ICONC)" LIB=$(LIB) BIN=$(BIN) uninstall)
+ (cd lib && $(MAKE) LIB=$(LIB) uninstall)
@ I do the [[<<shell binaries>>]] before [[$(LIBSRC)]] so that the
- Icon version of [[htmltoc]], if present, will overwrite the Perl
- version.
-@@ -91,37 +90,37 @@
+@@ -92,37 +91,37 @@
noroff
do
echo '@<<shell binaries@>>='
-- echo 'sed "s@|LIBDIR|@$(LIBNAME)@"' "shell/$i" '> $(BIN)/'"$i"
+- echo 'sed "s@|LIBDIR|@$(LIBNAME)@;s@|GITVERSION|@$(GITVERSION)@"' "shell/$i" '> $(BIN)/'"$i"
- echo 'chmod +x $(BIN)/'"$i"
-+ echo 'sed "s@|LIBDIR|@$(LIB)@"' "shell/$i" '> $(DESTDIR)$(BIN)/'"$i"
++ echo 'sed "s@|LIBDIR|@$(LIB)@;s@|GITVERSION|@$(GITVERSION)@"' "shell/$i" '> $(DESTDIR)$(BIN)/'"$i"
+ echo 'chmod +x $(DESTDIR)$(BIN)/'"$i"
echo '@<<uninstall shell binaries@>>='
- echo 'rm -f $(BIN)/'"$i"
-+ echo '$(RM) $(DESTDIR)$(BIN)/'"$i"
++ echo 'rm -f $(DESTDIR)$(BIN)/'"$i"
done
for i in toroff
do
@@ -1103,35 +494,34 @@ diff --git a/src/Makefile.nw b/src/Makefile.nw
+ echo 'chmod +x $(DESTDIR)$(LIB)/'"$i"
echo '@<<uninstall shell binaries@>>='
- echo 'rm -f $(LIB)/'"$i"
-+ echo '$(RM) $(DESTDIR)$(LIB)/'"$i"
++ echo 'rm -f $(DESTDIR)$(LIB)/'"$i"
done
<<*>>=
install-man:
-- mkdir -p $(MAN) $(MANDIR) $(MAN7DIR)
+- mkdir -p $(MANDIR) $(MAN7DIR)
+ mkdir -p $(DESTDIR)$(MANDIR) $(DESTDIR)$(MAN7DIR)
<<ordinary pages>>
uninstall-man:
<<uninstall ordinary pages>>
-- -rmdir $(MANDIR) $(MAN7DIR) $(MAN) 2>/dev/null || true
--@
-+ -rmdir $(DESTDIR)$(MANDIR) $(DESTDIR)$(MAN7DIR) $(DESTDIR)$(MAN) 2>/dev/null || true
-+@
+- rmdir $(MANDIR) $(MAN7DIR) $(MAN) 2>/dev/null || true
++ rmdir $(DESTDIR)$(MANDIR) $(DESTDIR)$(MAN7DIR) $(DESTDIR)$(MAN) 2>/dev/null || true
+ @
Slackware no longer uses preformatted compressed pages, just
compressed pages.
<<*>>=
install-gzipped-man:
-- mkdir -p $(MAN) $(MANDIR) $(MAN7DIR)
+- mkdir -p $(MANDIR) $(MAN7DIR)
+ mkdir -p $(DESTDIR)$(MANDIR) $(DESTDIR)$(MAN7DIR)
<<compressed pages>>
<<*>>=
install-preformat-man:
-echo "Warning: install-preformat-man is obsolete, even on Slackware systems" 1>&2
-- mkdir -p $(MAN) $(CATDIR) $(CAT7DIR)
+- mkdir -p $(CATDIR) $(CAT7DIR)
+ mkdir -p $(DESTDIR)$(CATDIR) $(DESTDIR)$(CAT7DIR)
<<preformatted compressed pages>>
<<generate chunks>>=
NORMALPAGES="cpif nodefs noroots noweb noindex nuweb2noweb notangle noroff sl2h htmltoc"
-@@ -131,98 +130,97 @@
+@@ -132,61 +131,61 @@
for i in $NORMALPAGES; do
echo '@<<ordinary pages@>>='
@@ -1141,7 +531,7 @@ diff --git a/src/Makefile.nw b/src/Makefile.nw
+ "xdoc/$i.1" '> $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT)'
echo '@<<uninstall ordinary pages@>>='
- echo 'rm -f $(MANDIR)/'"$i"'.$(MANEXT)'
-+ echo '$(RM) $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT)'
++ echo 'rm -f $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT)'
done
for i in $NORMAL7PAGES; do
echo '@<<ordinary pages@>>='
@@ -1151,18 +541,18 @@ diff --git a/src/Makefile.nw b/src/Makefile.nw
+ "xdoc/$i.7" '> $(DESTDIR)$(MAN7DIR)/'"$i"'.$(MAN7EXT)'
echo '@<<uninstall ordinary pages@>>='
- echo 'rm -f $(MAN7DIR)/'"$i"'.$(MAN7EXT)'
-+ echo '$(RM) $(DESTDIR)$(MAN7DIR)/'"$i"'.$(MAN7EXT)'
++ echo 'rm -f $(DESTDIR)$(MAN7DIR)/'"$i"'.$(MAN7EXT)'
done
for i in $LINKPAGES; do
echo '@<<ordinary pages@>>='
- echo 'rm -f $(MANDIR)/'"$i"'.$(MANEXT)'
-- echo '(cd $(MANDIR); ln notangle.$(MANEXT)' "$i"'.$(MANEXT))'
-+ echo '$(RM) $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT)'
+- echo '(cd $(MANDIR) && ln notangle.$(MANEXT)' "$i"'.$(MANEXT))'
++ echo 'rm -f $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT)'
+ echo '(cd $(DESTDIR)$(MANDIR) && ln -s notangle.$(MANEXT)' "$i"'.$(MANEXT))'
echo '@<<uninstall ordinary pages@>>='
- echo 'rm -f $(MANDIR)/'"$i"'.$(MANEXT)'
-+ echo '$(RM) $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT)'
++ echo 'rm -f $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT)'
done
echo '@<<compressed pages@>>='
@@ -1182,8 +572,8 @@ diff --git a/src/Makefile.nw b/src/Makefile.nw
for i in $LINKPAGES; do
- echo 'rm -f $(MANDIR)/'"$i"'.$(MANEXT).gz'
-- echo '(cd $(MANDIR); ln notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
-+ echo '$(RM) $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT).gz'
+- echo '(cd $(MANDIR) && ln notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
++ echo 'rm -f $(DESTDIR)$(MANDIR)/'"$i"'.$(MANEXT).gz'
+ echo '(cd $(DESTDIR)$(MANDIR) && ln -s notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
done
@@ -1204,90 +594,43 @@ diff --git a/src/Makefile.nw b/src/Makefile.nw
for i in $LINKPAGES; do
- echo 'rm -f $(CATDIR)/'"$i"'.$(MANEXT).gz'
-- echo '(cd $(CATDIR); ln notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
-+ echo '$(RM) $(DESTDIR)$(CATDIR)/'"$i"'.$(MANEXT).gz'
+- echo '(cd $(CATDIR) && ln notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
++ echo 'rm -f $(DESTDIR)$(CATDIR)/'"$i"'.$(MANEXT).gz'
+ echo '(cd $(DESTDIR)$(CATDIR) && ln -s notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
done
<<*>>=
install-tex:
- mkdir -p $(TEXINPUTS)
-- cp tex/nwmac.tex tex/noweb.sty $(TEXINPUTS)
+ mkdir -p $(DESTDIR)$(TEXINPUTS)
-+ cp tex/nwmac.tex tex/noweb.sty $(DESTDIR)$(TEXINPUTS)
+ <<tex installation>>
-texhash || echo "Program texhash not found or failed"
- uninstall-tex:
-- rm -f $(TEXINPUTS)/nwmac.tex $(TEXINPUTS)/noweb.sty || true
-+ $(RM) $(DESTDIR)$(TEXINPUTS)/nwmac.tex $(DESTDIR)$(TEXINPUTS)/noweb.sty || true
-
+@@ -196,17 +195,16 @@
+ for i in nwmac.tex noweb.sty
+ do
+ echo '@<<tex installation@>>='
+- echo 'sed "s@|GITVERSION|@$(GITVERSION)@"' "tex/$i" '> $(TEXINPUTS)/'"$i"
++ echo 'sed "s@|GITVERSION|@$(GITVERSION)@"' "tex/$i" '> $(DESTDIR)$(TEXINPUTS)/'"$i"
+ echo '@<<tex uninstallation@>>='
+- echo 'rm -f $(TEXINPUTS)/'"$i"
++ echo 'rm -f $(DESTDIR)$(TEXINPUTS)/'"$i"
+ done
+ <<*>>=
install-elisp:
- if [ "/dev/null" != "$(ELISP)" ]; then mkdir -p $(ELISP); fi
- cp elisp/noweb-mode.el $(ELISP)
+ if [ "/dev/null" != "$(ELISP)" ]; then mkdir -p $(DESTDIR)$(ELISP) && cp elisp/noweb-mode.el $(DESTDIR)$(ELISP); fi
uninstall-elisp:
-- rm -f $(ELISP)/noweb-mode.el || true
--@
-+ if [ "/dev/null" != "$(ELISP)" ]; then $(RM) $(DESTDIR)$(ELISP)/noweb-mode.el; fi
-+@
+- rm -f $(ELISP)/noweb-mode.el
++ if [ "/dev/null" != "$(ELISP)" ]; then rm -f $(DESTDIR)$(ELISP)/noweb-mode.el; fi
+ @
<<*>>=
- checkin:
-- for i in lib tex xdoc; do (cd $$i; make "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin); done
-- for i in c icon awk; do (cd $$i; ci -l $(CINAME) $(CIMSG) *.nw Makefile); done
-- (cd elisp; ci -l $(CINAME) $(CIMSG) *.el)
-+ for i in lib tex xdoc; do $(MAKE) -C $$i "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" $@; done
-+ for i in c icon awk; do (cd $$i && ci -l $(CINAME) $(CIMSG) *.nw Makefile); done
-+ (cd elisp && ci -l $(CINAME) $(CIMSG) *.el)
- ci -l $(CINAME) $(CIMSG) Makefile.nw INSTALL INSTALL.DOS README FAQ COPYRIGHT nwmake *.nw
-
source: FAQ
-- for i in c shell lib xdoc icon awk tex; do (cd $$i; make CPIF=">" source); done
-+ for i in c shell lib xdoc icon awk tex; do $(MAKE) -C $$i CPIF=">" $@; done
- sleep 1
-- for i in c shell lib xdoc icon awk tex; do (cd $$i; make touch); done
-+ for i in c shell lib xdoc icon awk tex; do $(MAKE) -C $$i touch; done
- touch:
- touch FAQ
-- for i in c shell lib xdoc icon awk tex; do (cd $$i; make touch); done
-+ for i in c shell lib xdoc icon awk tex; do $(MAKE) -C $$i $@; done
- boot:
-- for i in c shell lib xdoc icon awk tex; do (cd $$i; make boot); done
-+ for i in c shell lib xdoc icon awk tex; do $(MAKE) -C $$i $@; done
- clean:
-- for i in c shell lib xdoc icon awk tex; do (cd $$i; make clean); done
-- rm -f nwsrcfilter *~ */*~
-+ for i in c shell lib xdoc icon awk tex; do $(MAKE) -C $$i $@; done
-+ $(RM) nwsrcfilter *~ */*~
-
- clobber: clean
-- for i in c shell lib xdoc icon awk tex; do (cd $$i; make clobber); done
-+ for i in c shell lib xdoc icon awk tex; do $(MAKE) -C $$i $@; done
-
- Makefile: Makefile.nw
-- chmod +w Makefile
-- notangle -R'script' Makefile.nw | sh > Makefile
-- chmod -w Makefile
-+ chmod +w $@
-+ notangle -R'script' $< | sh > $@
-+ chmod -w $@
diff --git a/src/awk/Makefile b/src/awk/Makefile
--- a/src/awk/Makefile
+++ b/src/awk/Makefile
-@@ -8,11 +8,10 @@
- LIBEXECSBARE=noidx tohtml
- LIBEXECSDEP=totex
- LIBEXECS=$(LIBEXECSBARE) $(LIBEXECSDEP)
--BINEXECS=noindex
-+BINEXECS=noindex
- EXECS=$(BINEXECS) $(LIBEXECS)
-
--all: $(EXECS)
-- chmod +x $(EXECS)
-+all: $(EXECS)
- sources: $(EXECS)
- touch: $(EXECS)
- touch $(EXECS)
-@@ -20,28 +19,33 @@
+@@ -19,13 +19,13 @@
touch $(EXECS)
install: all
@@ -1301,214 +644,15 @@ diff --git a/src/awk/Makefile b/src/awk/Makefile
uninstall:
- for i in $(LIBEXECS); do rm -f $(LIB)/$$i; done
- for i in $(BINEXECS); do rm -f $(BIN)/$$i; done
-+ for i in $(LIBEXECS); do $(RM) $(DESTDIR)$(LIB)/$$i; done
-+ for i in $(BINEXECS); do $(RM) $(DESTDIR)$(BIN)/$$i; done
++ for i in $(LIBEXECS); do rm -f $(DESTDIR)$(LIB)/$$i; done
++ for i in $(BINEXECS); do rm -f $(DESTDIR)$(BIN)/$$i; done
source: $(EXECS)
- totex: totex.nw
-- notangle -Rtotex totex.nw > totex
-+ notangle -R$@ $< > $@
-+ chmod +x $@
-
- noidx: noidx.nw
-- notangle noidx.nw > noidx
-+ notangle $< > $@
-+ chmod +x $@
-
- tohtml: tohtml.nw
-- notangle tohtml.nw > tohtml
-+ notangle $< > $@
-+ chmod +x $@
-
--noindex: noindex.nw
-- notangle -Rnoindex noindex.nw > noindex
-+noindex: noindex.nw
-+ notangle -R$@ $< > $@
-+ chmod +x $@
-
--clean: ; rm -f *.log *.blg *.dvi *.toc *.aux *.tex *~ *.html
-+clean:
-+ $(RM) *.log *.blg *.dvi *.toc *.aux *.tex *~ *.html
- clobber: clean
-- rm -f totex noidx tohtml noindex
-+ $(RM) totex noidx tohtml noindex
-diff --git a/src/c/Makefile b/src/c/Makefile
---- a/src/c/Makefile
-+++ b/src/c/Makefile
-@@ -14,9 +14,9 @@
- main.o errors.o columns.o
- MARKUPOBJS=markmain.o strsave.o markup.o errors.o getline.o columns.o
- FILES=markmain.nw markup.nw \
-- main.nw notangle.nw match.nw mnt.nw modules.nw modtrees.nw \
-- finduses.nw recognize.nw \
-- getline.nw columns.nw errors.nw strsave.nw
-+ main.nw notangle.nw match.nw mnt.nw modules.nw modtrees.nw \
-+ finduses.nw recognize.nw \
-+ getline.nw columns.nw errors.nw strsave.nw
-
- SRCS=columns.h errors.h getline.h markup.h match.h modtrees.h \
- modules.h notangle.h recognize.h strsave.h \
-@@ -32,81 +32,78 @@
- CPIF=>
-
- .SUFFIXES: .nw .tex .dvi .h
--.nw.tex: ; noweave $*.nw >$*.tex
--.nw.c: ; $(NOTANGLE) -L $*.nw >$*.c
--.nw.o: ; $(NOTANGLE) -L $*.nw >$*.c
-- $(CC) $(CFLAGS) -c $*.c
--.nw.h: ; $(NOTANGLE) -Rheader $*.nw $(CPIF) $*.h
-+.nw.tex:
-+ noweave $< >$@
-+.nw.c:
-+ $(NOTANGLE) -L $< >$@
-+.nw.h:
-+ $(NOTANGLE) -Rheader $< $(CPIF) $@
-
--all: nt markup mnt finduses nwmktemp
-+all: nt markup mnt finduses nwmktemp
-
--nt: $(TANGLEOBJS)
-- $(CC) $(CFLAGS) -o nt $(TANGLEOBJS)
-+nt: $(TANGLEOBJS)
-+ $(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
-
- nwmktemp: nwmktemp.o
-- $(CC) $(CFLAGS) -o nwmktemp nwmktemp.o
-+finduses: $(FINDUSESOBJS)
-+markup: $(MARKUPOBJS)
-+mnt: $(MNTOBJS)
-
--finduses: $(FINDUSESOBJS)
-- $(CC) $(CFLAGS) -o finduses $(FINDUSESOBJS)
--
--markup: $(MARKUPOBJS)
-- $(CC) $(CFLAGS) -o markup $(MARKUPOBJS)
--
--mnt: $(MNTOBJS)
-- $(CC) $(CFLAGS) -o mnt $(MNTOBJS)
--
--source: $(SRCS)
-+source: $(SRCS)
- touch: $(SRCS)
- touch $(SRCS)
-
--boot: ; touch $(SRCS)
-+boot:
-+ touch $(SRCS)
-
--clean: ; rm -f nt markup mnt finduses fakepretty
-- rm -f core *.makelog *.tex *.log *.blg *.dvi *.o *.toc *~
-- rm -f *.atac *.trace *.html
-+clean:
-+ $(RM) nt markup mnt finduses fakepretty
-+ $(RM) core *.makelog *.tex *.log *.blg *.dvi *.o *.toc *~
-+ $(RM) *.atac *.trace *.html
-
--clobber: clean
-- rm -f $(SRCS) fakepretty.c pretty.[ch]
-+clobber: clean
-+ $(RM) $(SRCS) fakepretty.c pretty.[ch]
-
--checkin: $(FILES) doc.nw
-- ci $(CINAME) $(CIMSG) -l $(FILES) doc.nw
-+checkin: $(FILES) doc.nw
-+ ci $(CINAME) $(CIMSG) -l $(FILES) doc.nw
-
--doc.tex: doc.nw
-- cp doc.nw doc.tex
-+doc.tex: doc.nw
-+ cp $< $@
-
- allcode.tex: $(FILES)
-- noweave -n -index $(FILES) > allcode.tex
-+ noweave -n -index $^ > $@
-
--doc.dvi: doc.tex allcode.tex
-- latex doc; latex doc; latex doc
-+doc.dvi: doc.tex allcode.tex
-+ latex doc
-+ latex doc
-+ latex doc
-
- doc.ps: doc.dvi
- dvips doc
-
- markup.ps: markmain.nw
-- notangle -Rmarkup.dot markmain.nw | dot -Tps > markup.ps
-+ notangle -Rmarkup.dot $< | dot -Tps > $@
-
- FPOBJS=fakepretty.o pretty.o errors.o getline.o match.o strsave.o columns.o
-
- fakepretty.o: pretty.h
-
- fakepretty: $(FPOBJS)
-- $(CC) $(CFLAGS) -o fakepretty $(FPOBJS)
-
-
--columns.o: columns.h
--errors.o: errors.h
--finduses.o: errors.h match.h getline.h recognize.h
--getline.o: columns.h errors.h getline.h
-+columns.o: columns.h
-+errors.o: errors.h
-+finduses.o: errors.h match.h getline.h recognize.h
-+getline.o: columns.h errors.h getline.h
- main.o: notangle.h errors.h columns.h modules.h modtrees.h
--markmain.o: errors.h markup.h getline.h columns.h
--markup.o: markup.h strsave.h errors.h
--match.o: match.h
--mnt.o: modules.h modtrees.h notangle.h errors.h columns.h strsave.h
--modtrees.o: strsave.h modules.h modtrees.h errors.h
--modules.o: modules.h modtrees.h errors.h columns.h strsave.h
--notangle.o: strsave.h getline.h modules.h modtrees.h errors.h match.h notangle.h
-+markmain.o: errors.h markup.h getline.h columns.h
-+markup.o: markup.h strsave.h errors.h
-+match.o: match.h
-+mnt.o: modules.h modtrees.h notangle.h errors.h columns.h strsave.h
-+modtrees.o: strsave.h modules.h modtrees.h errors.h
-+modules.o: modules.h modtrees.h errors.h columns.h strsave.h
-+notangle.o: strsave.h getline.h modules.h modtrees.h errors.h match.h notangle.h
- nwmktemp.o:
--pretty.o: getline.h match.h errors.h pretty.h strsave.h
--recognize.o:
--strsave.o: strsave.h errors.h
-+pretty.o: getline.h match.h errors.h pretty.h strsave.h
-+recognize.o:
-+strsave.o: strsave.h errors.h
diff --git a/src/icon/Makefile b/src/icon/Makefile
--- a/src/icon/Makefile
+++ b/src/icon/Makefile
-@@ -6,23 +6,23 @@
- CPIF=| cpif # change to ">" to insure all sources always made
-
- LIBEXECS=totex disambiguate noidx tohtml elide l2h docs2comments \
-- autodefs.tex autodefs.icon autodefs.yacc autodefs.sml autodefs.pascal \
-+ autodefs.tex autodefs.icon autodefs.yacc autodefs.sml autodefs.pascal \
- autodefs.promela autodefs.lrtl autodefs.asdl autodefs.mmix xchunks pipedocs
- LIBSPECIAL=autodefs.cee
- BINEXECS=noindex sl2h htmltoc
- EXECS=$(LIBEXECS) $(BINEXECS) $(LIBSPECIAL) pdcached
- SRCS=totex.icn disambiguate.icn noidx.icn texdefs.icn icondefs.icn \
-- yaccdefs.icn noindex.icn smldefs.icn tohtml.icn cdefs.icn elide.icn \
-+ yaccdefs.icn noindex.icn smldefs.icn tohtml.icn cdefs.icn elide.icn \
- l2h.icn sl2h.icn pascaldefs.icn promeladefs.icn lrtldefs.icn asdldefs.icn \
- mmixdefs.icn htmltoc.icn xchunks.icn docs2comments.icn pipedocs.icn pdcached.icn
-
- .SUFFIXES: .nw .icn .html .tex .dvi
- .nw.icn:
-- notangle -L'#line %-1L "%F"%N' $*.nw $(CPIF) $*.icn
-+ notangle -L'#line %-1L "%F"%N' $< $(CPIF) $@
- .nw.html:
-- noweave -filter l2h -autodefs icon -html -index $*.nw | htmltoc > $*.html
-+ noweave -filter l2h -autodefs icon -html -index $< | htmltoc > $@
- .nw.tex:
-- noweave -delay -autodefs icon -index $*.nw > $*.tex
-+ noweave -delay -autodefs icon -index $< > $@
- .tex.dvi:
- latex $*; while grep -s 'Rerun to get cross' $*.log; do latex $*; done
-
-@@ -34,118 +34,118 @@
+@@ -34,15 +34,15 @@
boot:
touch $(SRCS)
@@ -1525,156 +669,12 @@ diff --git a/src/icon/Makefile b/src/icon/Makefile
- for i in $(LIBEXECS); do rm -f $(LIB)/$$i; done
- for i in $(BINEXECS); do rm -f $(BIN)/$$i; done
- rm -f $(LIB)/autodefs.c
-+ for i in $(LIBEXECS); do $(RM) $(DESTDIR)$(LIB)/$$i; done
-+ for i in $(BINEXECS); do $(RM) $(DESTDIR)$(BIN)/$$i; done
-+ $(RM) $(DESTDIR)$(LIB)/autodefs.c
++ for i in $(LIBEXECS); do rm -f $(DESTDIR)$(LIB)/$$i; done
++ for i in $(BINEXECS); do rm -f $(DESTDIR)$(BIN)/$$i; done
++ rm -f $(DESTDIR)$(LIB)/autodefs.c
clean:
-- /bin/rm -f *.tex *.dvi *.aux *.log *.blg *.bbl *~ *.toc *.html *.u1 *.u2
-- /bin/rm -f *.[ch] *.ps *.gz
-- /bin/rm -f $(EXECS)
-- /bin/rm -f sl2h
-+ $(RM) *.tex *.dvi *.aux *.log *.blg *.bbl *~ *.toc *.html *.u1 *.u2
-+ $(RM) *.[ch] *.ps *.gz
-+ $(RM) $(EXECS)
-+ $(RM) sl2h
-
- clobber: clean
-- /bin/rm -f *.icn
-+ $(RM) *.icn
-
- texdefs.icn: texdefs.nw defns.nw
-- notangle -L'#line %-1L "%F"%N' texdefs.nw defns.nw $(CPIF) texdefs.icn
-+ notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
- icondefs.icn: icondefs.nw defns.nw
-- notangle -L'#line %-1L "%F"%N' icondefs.nw defns.nw $(CPIF) icondefs.icn
-+ notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
- yaccdefs.icn: yaccdefs.nw defns.nw
-- notangle -L'#line %-1L "%F"%N' yaccdefs.nw defns.nw $(CPIF) yaccdefs.icn
-+ notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
- smldefs.icn: smldefs.nw defns.nw
-- notangle -L'#line %-1L "%F"%N' smldefs.nw defns.nw $(CPIF) smldefs.icn
-+ notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
- cdefs.icn: cdefs.nw defns.nw
-- notangle -L'#line %-1L "%F"%N' cdefs.nw defns.nw $(CPIF) cdefs.icn
-+ notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
- pascaldefs.icn: pascaldefs.nw defns.nw
-- notangle -L'#line %-1L "%F"%N' pascaldefs.nw defns.nw $(CPIF) pascaldefs.icn
-+ notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
- promeladefs.icn: promeladefs.nw defns.nw
-- notangle -L'#line %-1L "%F"%N' promeladefs.nw defns.nw $(CPIF) promeladefs.icn
-+ notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
- lrtldefs.icn: lrtldefs.nw defns.nw
-- notangle -L'#line %-1L "%F"%N' lrtldefs.nw defns.nw $(CPIF) lrtldefs.icn
-+ notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
- asdldefs.icn: asdldefs.nw defns.nw
-- notangle -L'#line %-1L "%F"%N' asdldefs.nw defns.nw $(CPIF) asdldefs.icn
-+ notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
- mmixdefs.icn: mmixdefs.nw defns.nw
-- notangle -L'#line %-1L "%F"%N' mmixdefs.nw defns.nw $(CPIF) mmixdefs.icn
-+ notangle -L'#line %-1L "%F"%N' $^ $(CPIF) $@
-
- autodefs.tex: texdefs.icn
-- $(ICONT) -o autodefs.tex texdefs.icn
-+ $(ICONT) -o $@ $<
-
- autodefs.icon: icondefs.icn
-- $(ICONC) -o autodefs.icon icondefs.icn
-+ $(ICONC) -o $@ $<
-
- autodefs.yacc: yaccdefs.icn
-- $(ICONT) -o autodefs.yacc yaccdefs.icn
-+ $(ICONT) -o $@ $<
-
- autodefs.sml: smldefs.icn
-- $(ICONT) -o autodefs.sml smldefs.icn
-+ $(ICONT) -o $@ $<
-
- autodefs.cee: cdefs.icn
-- $(ICONT) -o autodefs.cee cdefs.icn
-+ $(ICONT) -o $@ $<
-
- autodefs.pascal: pascaldefs.icn
-- $(ICONT) -o autodefs.pascal pascaldefs.icn
-+ $(ICONT) -o $@ $<
-
- autodefs.promela: promeladefs.icn
-- $(ICONT) -o autodefs.promela promeladefs.icn
-+ $(ICONT) -o $@ $<
-
- autodefs.lrtl: lrtldefs.icn
-- $(ICONT) -o autodefs.lrtl lrtldefs.icn
-+ $(ICONT) -o $@ $<
-
- autodefs.asdl: asdldefs.icn
-- $(ICONT) -o autodefs.asdl asdldefs.icn
-+ $(ICONT) -o $@ $<
-
- autodefs.mmix: mmixdefs.icn
-- $(ICONT) -o autodefs.mmix mmixdefs.icn
-+ $(ICONT) -o $@ $<
-
- totex: totex.icn
-- $(ICONC) totex.icn
-+ $(ICONC) $<
-
- totexnr: totexnr.icn
-- $(ICONT) totexnr.icn
-+ $(ICONT) $<
-
- tohtml: tohtml.icn
-- $(ICONC) tohtml.icn
-+ $(ICONC) $<
-
- docs2comments: docs2comments.icn
-- $(ICONT) docs2comments.icn # no longer compiles with iconc
-+ $(ICONT) $< # no longer compiles with iconc
-
- xchunks: xchunks.icn
-- $(ICONT) xchunks.icn
-+ $(ICONT) $<
-
- l2h.icn: l2h.nw
-- notangle -L'#line %-1L "%F"%N' -R'l2h.icn' l2h.nw $(CPIF) l2h.icn
-+ notangle -L'#line %-1L "%F"%N' -R$@ $< $(CPIF) $@
- l2h: l2h.icn
-- $(ICONT) -o l2h l2h.icn # no longer compiles with iconc
-+ $(ICONT) -o $@ $< # no longer compiles with iconc
-
- sl2h.icn: l2h.nw
-- notangle -L'#line %-1L "%F"%N' -R'sl2h.icn' l2h.nw $(CPIF) sl2h.icn
-+ notangle -L'#line %-1L "%F"%N' -R$@ $< $(CPIF) $@
- sl2h: sl2h.icn
-- $(ICONT) -o sl2h sl2h.icn # no longer compiles with iconc
-+ $(ICONT) -o $@ $< # no longer compiles with iconc
-
- noindex: noindex.icn
-- $(ICONT) noindex.icn
-+ $(ICONT) $<
-
- noidx: noidx.icn
-- $(ICONT) noidx.icn # no longer compiles with iconc
-+ $(ICONT) $< # no longer compiles with iconc
-
- elide: elide.icn
-- $(ICONT) elide.icn
-+ $(ICONT) $<
-
- pipedocs: pipedocs.icn
-- $(ICONT) pipedocs.icn
-+ $(ICONT) $<
-
- pdcached: pdcached.icn
-- $(ICONT) pdcached.icn
-+ $(ICONT) $<
-
- disambiguate: disambiguate.icn
-- $(ICONT) disambiguate.icn
-+ $(ICONT) $<
-
- htmltoc: htmltoc.icn
-- $(ICONT) htmltoc.icn
-+ $(ICONT) $<
+ rm -f *.tex *.dvi *.aux *.log *.blg *.bbl *~ *.toc *.html *.u1 *.u2
diff --git a/src/lib/Makefile b/src/lib/Makefile
--- a/src/lib/Makefile
+++ b/src/lib/Makefile
@@ -1693,27 +693,13 @@ diff --git a/src/lib/Makefile b/src/lib/Makefile
+ sed 's@|LIBDIR|@$(LIB)@g' h2a > $(DESTDIR)$(LIB)/h2a
+ chmod +x $(DESTDIR)$(LIB)/pipedocs $(DESTDIR)$(LIB)/toascii $(DESTDIR)$(LIB)/h2a
- uninstall:
+ uninstall:
- for i in unmarkup emptydefn toascii nwmtime h2a btdefn; do rm -f $(LIB)/$$i; done
- rm -f $(LIB)/pipedocs
-+ for i in unmarkup emptydefn toascii nwmtime pipedocs h2a btdefn; do $(RM) $(DESTDIR)$(LIB)/$$i; done
-
- checkin:
- ci -l $(CINAME) $(CIMSG) $(RCSFILES)
-@@ -31,8 +30,10 @@
- touch toascii
-
- toascii: toascii.nw
-- notangle -Rtoascii toascii.nw > toascii
-+ notangle -R$@ $< > $@
-+ chmod +x $@
++ for i in unmarkup emptydefn toascii nwmtime pipedocs h2a btdefn; do rm -f $(DESTDIR)$(LIB)/$$i; done
--clean: ; rm -f *.log *.blg *.dvi *.toc *.aux *.tex *~
-+clean:
-+ $(RM) *.log *.blg *.dvi *.toc *.aux *.tex *~
- clobber: clean
-- rm -f toascii
-+ $(RM) toascii
+ source: toascii
+ touch: toascii
diff --git a/src/shell/Makefile b/src/shell/Makefile
--- a/src/shell/Makefile
+++ b/src/shell/Makefile
@@ -1725,197 +711,23 @@ diff --git a/src/shell/Makefile b/src/shell/Makefile
EXEC=noweave noweb notangle noroff toroff
SRCS=$(EXEC) tmac.w
-@@ -9,9 +8,9 @@
- CINAME=
- CIMSG=
-
--all: $(SRCS)
-+all: $(SRCS)
- source: $(SRCS)
--touch: $(SRCS)
-+touch: $(SRCS)
- touch $(SRCS)
- boot:
- touch $(SRCS)
-@@ -20,16 +19,18 @@
- ci -l $(CINAME) $(CIMSG) $(RCSFILES)
-
- noweave: noweave.nw
-- notangle -Rnoweave noweave.nw > noweave
-+ notangle -R$@ $< > $@
-
- notangle: notangle.nw
-- notangle -Rnotangle notangle.nw > notangle
-+ notangle -R$@ $< > $@
-
--noweb: noweb.nw
-- notangle -Rnoweb noweb.nw > noweb
-+noweb: noweb.nw
-+ notangle -R$@ $< > $@
-
- noroff toroff tmac.w: roff.nw
-- noweb -t roff.nw
-+ noweb -t $<
-
--clean: ; rm -f *.log *.blg *.dvi *.toc *.aux *.tex *~ *.nwt roff.mm
--clobber: clean ; rm -f $(SRCS)
-+clean:
-+ $(RM) *.log *.blg *.dvi *.toc *.aux *.tex *~ *.nwt roff.mm
-+clobber: clean
-+ $(RM) $(SRCS)
-diff --git a/src/tex/Makefile b/src/tex/Makefile
---- a/src/tex/Makefile
-+++ b/src/tex/Makefile
-@@ -14,15 +14,15 @@
- ci -l $(CINAME) $(CIMSG) $(RCSFILES)
-
- nwmac.tex: support.nw
-- notangle -Rnwmac.tex support.nw > nwmac.tex
-+ notangle -R$@ $< > $@
-
- noweb.sty: support.nw
-- notangle -Rnoweb.sty support.nw > noweb.sty
-+ notangle -R$@ $< > $@
-
- support.tex: support.nw
-- noweave -delay -x support.nw > support.tex
-+ noweave -delay -x $< > $@
-
--clean:
-- /bin/rm -f *~ *.dvi *.aux *.log *.blg *.bbl *.toc
-- /bin/rm -f support.tex
-+clean:
-+ $(RM) *~ *.dvi *.aux *.log *.blg *.bbl *.toc
-+ $(RM) support.tex
- clobber: clean
diff --git a/src/xdoc/Makefile b/src/xdoc/Makefile
--- a/src/xdoc/Makefile
+++ b/src/xdoc/Makefile
-@@ -1,16 +1,20 @@
- WWW=$(HOME)/www/noweb
- SHELL=/bin/sh
- .SUFFIXES: .1 .7 .txt .ps
--.1.txt: ; nroff -man $*.1 > $*.txt
--.1.ps: ; psroff -t -man $*.1 > $*.ps
--.7.txt: ; nroff -man $*.7 > $*.txt
--.7.ps: ; psroff -t -man $*.7 > $*.ps
-+.1.txt:
-+ nroff -man $< > $@
-+.1.ps:
-+ psroff -t -man $< > $@
-+.7.txt:
-+ nroff -man $< > $@
-+.7.ps:
-+ psroff -t -man $< > $@
-
- MANPAGES=notangle.1 cpif.1 noweb.1 nodefs.1 noroots.1 noindex.1 \
-- nowebstyle.7 nowebfilters.7 nuweb2noweb.1 sl2h.1 htmltoc.1 \
-+ nowebstyle.7 nowebfilters.7 nuweb2noweb.1 sl2h.1 htmltoc.1 \
- noroff.1
- TXTPAGES=notangle.txt cpif.txt noweb.txt nodefs.txt noroots.txt noindex.txt \
-- nowebstyle.txt nowebfilters.txt nuweb2noweb.txt sl2h.txt htmltoc.txt \
-+ nowebstyle.txt nowebfilters.txt nuweb2noweb.txt sl2h.txt htmltoc.txt \
- noroff.txt
- SRCS=$(MANPAGES) $(TXTPAGES)
-
-@@ -32,52 +36,52 @@
- ci -l $(CINAME) $(CIMSG) $(RCSFILES)
+@@ -33,13 +33,13 @@
+ www: $(WWW)/onepage.ps $(WWW)/guide.ps $(WWW)/guide.html
$(WWW)/onepage.ps: onepage.ps
- cp onepage.ps $(WWW)
-+ cp $< $@
++ cp onepage.ps $@
$(WWW)/guide.ps: guide.ps
- cp guide.ps $(WWW)
-+ cp $< $@
++ cp guide.ps $@
$(WWW)/guide.html: guide.html
- cp guide.html $(WWW)
-+ cp $< $@
++ cp guide.html $@
notangle.1: manpage.nw ../shell/noweave.nw docdate.nw
-- notangle -t8 -Rnotangle.1 manpage.nw ../shell/noweave.nw docdate.nw | $(DOVERSION) > notangle.1
-+ notangle -t8 -R$@ $^ | $(DOVERSION) > $@
-
- nowebstyle.7: manpage.nw ../tex/support.nw docdate.nw
-- notangle -t8 -Rnowebstyle.7 manpage.nw ../tex/support.nw docdate.nw | $(DOVERSION) > nowebstyle.7
-+ notangle -t8 -R$@ $^ | $(DOVERSION) > $@
-
- nowebfilters.7: nowebfilters.nw docdate.nw
-- notangle -t8 nowebfilters.nw docdate.nw | $(DOVERSION) > nowebfilters.7
-+ notangle -t8 $^ | $(DOVERSION) > $@
-
- noweb.1: manpage.nw docdate.nw
-- notangle -t8 -Rnoweb.1 manpage.nw docdate.nw | $(DOVERSION) > noweb.1
-+ notangle -t8 -R$@ $^ | $(DOVERSION) > $@
-
- nodefs.1: nodefs.nw docdate.nw
-- notangle -t8 nodefs.nw docdate.nw | $(DOVERSION) > nodefs.1
-+ notangle -t8 $^ | $(DOVERSION) > $@
-
- noroots.1: noroots.nw docdate.nw
-- notangle -t8 noroots.nw docdate.nw | $(DOVERSION) > noroots.1
-+ notangle -t8 $^ | $(DOVERSION) > $@
-
- noindex.1: noindex.nw docdate.nw
-- notangle -t8 noindex.nw docdate.nw | $(DOVERSION) > noindex.1
-+ notangle -t8 $^ | $(DOVERSION) > $@
-
- sl2h.1: sl2h.nw docdate.nw
-- notangle -t8 sl2h.nw docdate.nw | $(DOVERSION) > sl2h.1
-+ notangle -t8 $^ | $(DOVERSION) > $@
-
- htmltoc.1: htmltoc.nw docdate.nw
-- notangle -t8 htmltoc.nw docdate.nw | $(DOVERSION) > htmltoc.1
-+ notangle -t8 $^ | $(DOVERSION) > $@
-
- cpif.1: manpage.nw docdate.nw
-- notangle -t8 -Rcpif.1 manpage.nw docdate.nw | $(DOVERSION) > cpif.1
-+ notangle -t8 -R$@ $^ | $(DOVERSION) > $@
-
- nuweb2noweb.1: manpage.nw docdate.nw
-- notangle -t8 -Rnuweb2noweb.1 manpage.nw docdate.nw | $(DOVERSION) > nuweb2noweb.1
-+ notangle -t8 -R$@ $^ | $(DOVERSION) > $@
-
- noroff.1: noroff.nw docdate.nw
-- notangle -t8 noroff.nw docdate.nw | $(DOVERSION) > noroff.1
-+ notangle -t8 $^ | $(DOVERSION) > $@
-
- wc.tex: ../../examples/wc.nw
-- (cd ../../examples; noweave -n -index wc.nw) > wc.tex
-+ (cd ../../examples; noweave -n -index wc.nw) > $@
-
- techrep.dvi: techrep.tex wc.tex
- latex '\scrollmode \input '"techrep"
-@@ -88,23 +92,23 @@
- while grep -s 'Rerun to get cross-references right' onepage.log; do latex '\scrollmode \input '"onepage"; done
-
- onepage.ps: onepage.dvi
-- dvips -P cmz -o onepage.ps onepage
-+ dvips -P cmz -o $@ onepage
-
- guide.dvi: guide.tex
- latex '\scrollmode \input '"guide"
- while grep -s 'Rerun to get cross-references right' guide.log; do latex '\scrollmode \input '"guide"; done
-
- guide.ps: guide.dvi
-- dvips -P cmz -o guide.ps guide
-+ dvips -P cmz -o $@ guide
-
- guide.uu: guide.ps
-- gzip < guide.ps > guide.ps.gz
-- uuencode guide.ps.gz < guide.ps.gz > guide.uu
-+ gzip < $< > guide.ps.gz
-+ uuencode guide.ps.gz < guide.ps.gz > $@
-
- guide.html: guide.dvi
-- sl2h guide.tex | htmltoc > guide.html
-+ sl2h guide.tex | htmltoc > $@
-
--clean: ; /bin/rm -f *.dvi *.log *.blg *~ wc.tex *.ps *.gz *.uu *.html
-+clean:
-+ $(RM) *.dvi *.log *.blg *~ wc.tex *.ps *.gz *.uu *.html
- clobber: clean
-- rm -f *.1 *.7 *.txt
--
-+ $(RM) *.1 *.7 *.txt
+ notangle -t8 -R$@ manpage.nw ../shell/noweave.nw docdate.nw | $(DOVERSION) > $@
diff --git a/development/noweb/patches/toascii.diff b/development/noweb/patches/toascii.diff
deleted file mode 100644
index a6f7fd2e81be..000000000000
--- a/development/noweb/patches/toascii.diff
+++ /dev/null
@@ -1,143 +0,0 @@
-diff --git a/src/.gitignore b/src/.gitignore
---- a/src/.gitignore
-+++ b/src/.gitignore
-@@ -1,3 +1,2 @@
- /texhash
- /solmake
--/lib/toascii
-diff --git a/src/lib/toascii b/src/lib/toascii
-new file mode 100755
---- /dev/null
-+++ b/src/lib/toascii
-@@ -0,0 +1,131 @@
-+#!/bin/sh
-+delay=0 noindex=0
-+for i do
-+ case $i in
-+ -delay) delay=1 ;;
-+ -noindex) noindex=1 ;;
-+ *) echo "This can't happen -- $i passed to toascii" 1>&2 ; exit 1 ;;
-+ esac
-+done
-+awkfile=$(mktemp)
-+textfile=$(mktemp)
-+tagsfile=$(mktemp)
-+export awkfile textfile tagsfile
-+trap 'rm -f $awkfile $textfile $tagsfile' 0 1 2 10 14 15
-+nawk 'BEGIN { textfile=ENVIRON["textfile"]
-+ tagsfile=ENVIRON["tagsfile"] }
-+ /^@begin code/ { ++secno }
-+ /^@xref label/ { print $3, secno >tagsfile }
-+ /^@((begin|end) (docs|code))/ { print >textfile }
-+ /^@(text|nl|defn|use)/ { print >textfile }
-+ /^@xref (ref|notused)/ { print >textfile }
-+ /^@xref (begin|end)(defs|uses)/ { print >textfile }
-+ /^@xref (def|use)item/ { print >textfile}
-+ /^@xref ((begin|end)chunks)|(chunk(begin|use|defn|end))/ { print >textfile }
-+ /^@index (begin|end)(defs|uses)/ { print >textfile }
-+ /^@index (is(us|defin)ed)|((def|use)item)/ { print >textfile }
-+ /^@index ((begin|end)index)|(entry(begin|use|defn|end))/ { print >textfile }'
-+nawk 'BEGIN {
-+ textfile = ENVIRON["textfile"]
-+ tagsfile = ENVIRON["tagsfile"]
-+ tfmt="detex | fmt -79"
-+ cfmt="expand -4 | fold -75 | sed \"s/^/ /\""
-+ xfmt="fold -75 | sed \"s/^/ /\""
-+ zfmt="cat"
-+ while (getline <tagsfile > 0)
-+ tag[$1] = $2
-+ close(tagsfile)
-+ }
-+ /^@begin docs/ { out = tfmt }
-+ /^@end docs/ { close(out) }
-+ /^@begin code/ { out = cfmt; code = 1; ++secno }
-+ /^@end code/ { endcode(); close(out); printf "\n" }
-+ /^@text/ { printf "%s", substr($0, 7) | out }
-+ /^@nl/ { # printf "(->%s)", formatname(out) | out ;
-+ printf "\n" | out }
-+ /^@xref ref/ { lastxrefref = tag[substr($0, 11)] }
-+ /^@defn/ { name = convquote(substr($0, 7))
-+ printf "\n### %d ### %s%s=",
-+ secno, chunkname(name, lastxrefref), defn[name]
-+ defn[name] = "+" }
-+ /^@use/ { name = convquote(substr($0, 6))
-+ printf "%s", chunkname(name, lastxrefref) | out }
-+ /^@xref begindefs/ { endcode()
-+ printf "This definition continued in" | out }
-+ /^@xref beginuses/ { endcode()
-+ printf "This code used in" | out }
-+ /^@xref notused/ { endcode()
-+ print "This code not used in this document." | out }
-+ /^@xref (def|use)item/ { addlist(tag[$3]) }
-+ /^@xref end(defs|uses)/ { printlist() }
-+ $0 ~ /^@index begindefs/ && !noindex {
-+ endcode()
-+ print "Defines:" | out }
-+
-+ $0 ~ /^@index isused/ && !noindex {
-+ if (tag[$3] != lastxrefref) addlist(tag[$3]) }
-+
-+ $0 ~ /^@index defitem/ && !noindex {
-+ printf " %s,", $3 | out
-+ if (nlist == 0) printf " not used in this document.\n" | out
-+ else { printf " used in" | out; printlist() } }
-+ $0 ~ /^@index beginuses/ && !noindex { endcode(); printf "Uses" | out }
-+ $0 ~ /^@index isdefined/ && !noindex { lastuse = tag[$3] }
-+ $0 ~ /^@index useitem/ && !noindex { addlist(sprintf("%s %s", $3, lastuse)) }
-+ $0 ~ /^@index enduses/ && !noindex { printlist() }
-+ /^@xref beginchunks/ { close(out); out = zfmt
-+ print "List of code chunks\n" | out }
-+ /^@xref chunkbegin/ { name = convquote(substr($0, length($3) + 19))
-+ printf "%s\n", chunkname(name, tag[$3]) | out }
-+ /^@xref chunkuse/ { addlist(tag[$3]) }
-+ /^@xref chunkdefn/ { }
-+ /^@xref chunkend/ { if (nlist == 0)
-+ print " Not used in this document." | out
-+ else { printf " Used in" | out; printlist() } }
-+ /^@xref endchunks/ { }
-+ $0 ~ /^@index beginindex/ && !noindex { print "\nList of identifiers (defini" \
-+ "tion in parentheses)\n" | out }
-+ $0 ~ /^@index entrybegin/ && !noindex { name = substr($0, length($3 + 19))
-+ lastdefn = tag[$3]
-+ printf "%s: ", $4 | out }
-+ $0 ~ /^@index entryuse/ && !noindex { addlist(tag[$3]) }
-+ $0 ~ /^@index entrydefn/ && !noindex { }
-+ $0 ~ /^@index entryend/ && !noindex { for (i = 1; i <= nlist; i++)
-+ if (list[i] == lastdefn)
-+ sub(/.*/, "(&)", list[i])
-+ if (nlist == 0)
-+ print "Not used." | out
-+ else printlist() }
-+ $0 ~ /^@index endindex/ && !noindex { }
-+ /^@fatal / { exit 1 }
-+ END {
-+ close(out)
-+ }
-+ function endcode() {
-+ if (code == 1) {
-+ code = 0
-+ close(out)
-+ out = xfmt
-+ printf "\n" | out } }
-+ function addlist(s, i) {
-+ for (i = 1; i <= nlist; i++)
-+ if (s == list[i]) return
-+ list[++nlist] = s }
-+
-+ function printlist( i) {
-+ if (nlist == 1) printf " %s.\n", list[1] | out
-+ else if (nlist == 2) printf " %s and %s.\n", list[1], list[2] | out
-+ else {
-+ for (i = 1; i < nlist; i++)
-+ printf " %s,", list[i] | out
-+ printf " and %s.\n", list[nlist] | out }
-+ for (i in list) delete list[i]
-+ nlist = 0 }
-+ function convquote(s) { gsub(/\[\[|\]\]/, "", s); return s }
-+ function chunkname(name, number) {
-+ if (number == 0)
-+ return sprintf("<%s>", name)
-+ else
-+ return sprintf("<%s %d>", name, number)
-+ }' noindex=$noindex $textfile
-+exit $?