diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /web/noweb/src/Makefile.nw |
Initial commit
Diffstat (limited to 'web/noweb/src/Makefile.nw')
-rw-r--r-- | web/noweb/src/Makefile.nw | 228 |
1 files changed, 228 insertions, 0 deletions
diff --git a/web/noweb/src/Makefile.nw b/web/noweb/src/Makefile.nw new file mode 100644 index 0000000000..079a844b09 --- /dev/null +++ b/web/noweb/src/Makefile.nw @@ -0,0 +1,228 @@ +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-2018 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 -O -Wall -Werror +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 || true + +install-shell: + mkdir -p $(BIN) $(LIB) + <<shell binaries>> + cp shell/tmac.w $(LIB) + +uninstall-shell: + <<uninstall shell binaries>> + rm -f $(LIB)/tmac.w + +install-code: install-shell + mkdir -p $(BIN) $(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 + +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 +@ 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 -p $(MAN) $(MANDIR) $(MAN7DIR) + <<ordinary pages>> +uninstall-man: + <<uninstall ordinary pages>> + -rmdir $(MANDIR) $(MAN7DIR) $(MAN) 2>/dev/null || true +@ +Slackware no longer uses preformatted compressed pages, just +compressed pages. +<<*>>= +install-gzipped-man: + mkdir -p $(MAN) $(MANDIR) $(MAN7DIR) + <<compressed pages>> +<<*>>= +install-preformat-man: + -echo "Warning: install-preformat-man is obsolete, even on Slackware systems" 1>&2 + mkdir -p $(MAN) $(CATDIR) $(CAT7DIR) + <<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 -p $(TEXINPUTS) + 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 || true + +install-elisp: + if [ "/dev/null" != "$(ELISP)" ]; then mkdir -p $(ELISP); fi + cp elisp/noweb-mode.el $(ELISP) + +uninstall-elisp: + rm -f $(ELISP)/noweb-mode.el || true +@ +<<*>>= +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 +boot: + for i in c shell lib xdoc icon awk tex; do (cd $$i; make boot); 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 shell lib xdoc icon awk tex; do (cd $$i; make clobber); done + +Makefile: Makefile.nw + chmod +w Makefile + notangle -R'script' Makefile.nw | sh > Makefile + chmod -w Makefile |