I got sick and tired of copying goo for multiple files.
This nonsense is the result. (Too bad mk isn't everywhere.)
<<script>>=
(cat Makefile.nw; echo ""; notangle -t8 -R'generate chunks' Makefile.nw | sh) | notangle -t8 -
<<*>>=
# Copyright 1995-2001 by Norman Ramsey. All rights reserved.
# See file COPYRIGHT for more information.
#
# Adjust these two lines for your ANSI C compiler
CC=gcc -ansi -pedantic
CFLAGS=
# If you have Icon, you should use the Icon versions of the noweb pipeline.
# Set LIBSRC=icon
LIBSRC=awk
# If you have no Icon compiler, but do have icont, make ICONC=icont
ICONC=iconc
ICONT=icont
# BIN is where the commands (notangle, noweave, nountangle, noroots) land
# LIB is where the pieces of the pipes (nt, markup, unmarkup) are stored
# MAN is the root of your local man pages directory
# MANEXT is the extension for your commands' man pages (usually 1 or l)
# 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
BIN=/usr/local/noweb
LIB=/usr/local/noweb/lib
MAN=/usr/local/noweb/man
MANEXT=1
MAN7EXT=7
TEXINPUTS=/usr/local/tex/inputs
ELISP=/dev/null
# change WEAVE if you want a different version of noweave to be installed
WEAVE=noweave
# Stop editing. No user-serviceable parts below.
SHELL=/bin/sh
CINAME=
CIMSG=
MANDIR=$(MAN)/man$(MANEXT)
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
FAQ: FAQ.html
sleep 1; html2ascii FAQ.html > FAQ
FAQ.html: $(HOME)/www/noweb/FAQ.html
rm -f FAQ.html
/bin/cp $(HOME)/www/noweb/FAQ.html FAQ.html
chmod -w FAQ.html
install: install-code install-man install-tex install-elisp
uninstall: uninstall-code uninstall-man uninstall-tex uninstall-elisp
-rmdir $(BIN) $(LIB) 2>/dev/null
install-shell:
-mkdir $(BIN) $(LIB) 2>/dev/null
<<shell binaries>>
cp shell/tmac.w $(LIB)
uninstall-shell:
<<uninstall shell binaries>>
rm $(LIB)/tmac.w
install-code: install-shell
-mkdir $(BIN) $(LIB) 2>/dev/null
strip c/nt c/markup c/mnt c/finduses
cp c/nt c/markup c/mnt c/finduses $(LIB)
cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
cd lib; make LIB=$(LIB) install
uninstall-code: uninstall-shell
rm $(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
@ I do the [[<<shell binaries>>]] before [[$(LIBSRC)]] so that the
Icon version of [[htmltoc]], if present, will overwrite the Perl
version.
@
<<generate chunks>>=
for i in noweb notangle '$(WEAVE)' nountangle nodefs noroots nuweb2noweb cpif htmltoc \
noroff
do
echo '@<<shell binaries@>>='
echo 'sed "s@|LIBDIR|@$(LIBNAME)@"' "shell/$i" '> $(BIN)/'"$i"
echo 'chmod +x $(BIN)/'"$i"
echo '@<<uninstall shell binaries@>>='
echo 'rm -f $(BIN)/'"$i"
done
for i in toroff
do
echo '@<<shell binaries@>>='
echo 'sed "s@|LIBDIR|@$(LIBNAME)@"' "shell/$i" '> $(LIB)/'"$i"
echo 'chmod +x $(LIB)/'"$i"
echo '@<<uninstall shell binaries@>>='
echo 'rm -f $(LIB)/'"$i"
done
<<*>>=
install-man:
-mkdir $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
<<ordinary pages>>
uninstall-man:
<<uninstall ordinary pages>>
@
Slackware no longer uses preformatted compressed pages, just
compressed pages.
<<*>>=
install-gzipped-man:
-mkdir $(MAN) $(MANDIR) $(MAN7DIR) 2>/dev/null
<<compressed pages>>
<<*>>=
install-preformat-man:
-echo "Warning: install-preformat-man is obsolete, even on Slackware systems" 1>&2
-mkdir $(MAN) $(CATDIR) $(CAT7DIR) 2>/dev/null
<<preformatted compressed pages>>
<<generate chunks>>=
NORMALPAGES="cpif nodefs noroots noweb noindex nuweb2noweb notangle noroff sl2h htmltoc"
NORMAL7PAGES="nowebstyle nowebfilters"
LINKPAGES="noweave nountangle"
for i in $NORMALPAGES; do
echo '@<<ordinary pages@>>='
echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
"xdoc/$i.1" '> $(MANDIR)/'"$i"'.$(MANEXT)'
echo '@<<uninstall ordinary pages@>>='
echo 'rm -f $(MANDIR)/'"$i"'.$(MANEXT)'
done
for i in $NORMAL7PAGES; do
echo '@<<ordinary pages@>>='
echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
"xdoc/$i.7" '> $(MAN7DIR)/'"$i"'.$(MAN7EXT)'
echo '@<<uninstall ordinary pages@>>='
echo 'rm -f $(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 '@<<uninstall ordinary pages@>>='
echo 'rm -f $(MANDIR)/'"$i"'.$(MANEXT)'
done
echo '@<<compressed pages@>>='
for i in $NORMALPAGES; do
echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
"xdoc/$i.1" ' | gzip -9 > $(MANDIR)/'"$i"'.$(MANEXT).gz'
done
for i in $NORMAL7PAGES; do
echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
"xdoc/$i.7" ' | gzip -9 > $(MAN7DIR)/'"$i"'.$(MAN7EXT).gz'
done
for i in $LINKPAGES; do
echo 'rm -f $(MANDIR)/'"$i"'.$(MANEXT).gz'
echo '(cd $(MANDIR); ln notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
done
echo '@<<preformatted compressed pages@>>='
for i in $NORMALPAGES; do
echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
"xdoc/$i.txt" ' | gzip > $(CATDIR)/'"$i"'.$(MANEXT).gz'
done
for i in $NORMAL7PAGES; do
echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
"xdoc/$i.txt" ' | gzip > $(CAT7DIR)/'"$i"'.$(MAN7EXT).gz'
done
for i in $LINKPAGES; do
echo 'rm -f $(CATDIR)/'"$i"'.$(MANEXT).gz'
echo '(cd $(CATDIR); ln notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
done
<<*>>=
install-tex:
-mkdir $(TEXINPUTS) 2>/dev/null
cp tex/nwmac.tex tex/noweb.sty $(TEXINPUTS)
-texhash || echo "Program texhash not found or failed"
uninstall-tex:
rm -f $(TEXINPUTS)/nwmac.tex $(TEXINPUTS)/noweb.sty
install-elisp:
-mkdir $(ELISP) 2>/dev/null
cp elisp/noweb-mode.el $(ELISP)
uninstall-elisp:
rm -f $(ELISP)/noweb-mode.el
@
<<*>>=
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)
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
sleep 1
for i in c shell lib xdoc icon awk tex; do (cd $$i; make touch); done
touch:
touch FAQ
for i in c shell lib xdoc icon awk tex; do (cd $$i; make touch); done
clean:
for i in c shell lib xdoc icon awk tex; do (cd $$i; make clean); done
rm -f nwsrcfilter *~ */*~
clobber: clean
for i in c lib icon awk xdoc; do (cd $$i; make clobber); done
Makefile: Makefile.nw
chmod +w Makefile
notangle -R'script' Makefile.nw | sh > Makefile
chmod -w Makefile
syntax highlighted by Code2HTML, v. 0.9.1