# Only works with Gnu make. # Needs Gnu m4 to implement assertions in Icon. # Change these two to suit your configuration: LIB=/opt/noweb/lib MPPLIB=/opt/noweb/mpp #---------------------------------------------------------------------- ICONT=icont TANGLE=notangle .SUFFIXES: .nw .icn .tex .dvi all: mpp autodefs.tangram install: cp -p mpp $(LIB) cp -p *pp_spec $(MPPLIB) mpp.tex: mpp.nw $(LIB)/markup $< | $(LIB)/autodefs.icon | $(LIB)/finduses -noquote \ | ./mpp -lib $(MPPLIB) -L Icon | $(LIB)/noidx -delay | $(LIB)/totex -delay > $@ %.dvi : %.tex latex $< # Don't delete the intermediate .tex file. .PRECIOUS : %.tex %.icn # Icon files, including assertions, via m4. # Tricky!! if a built-in macro matches smth. in your source, you've got problems. # Gnu m4 has --prefix-builtins which doesn't recognize built-in macros unless they # are prefixed with m4_ . So use Gnu m4. # An additional trick is that m4 uses ` ' to quote strings and will delete ` ' if # it sees them in your source! So we set m4's quote characters to null. %.icn : %.nw @echo 'm4_changequote( , )' > qq.m4 $(TANGLE) $< | \ m4 --prefix-builtins \ -D assert='($$1) | stop("Assertion failure on line ", &line, "!")' qq.m4 - > $@ # Executables % : %.icn $(ICONT) -o $@ $< # Executables: autodefs. tangramdefs.icn: tangramdefs.nw /opt/noweb/src/icon/defns.nw $(TANGLE) $^ > $@ autodefs.tangram: tangramdefs.icn $(ICONT) -o $@ $< # Cleaning: remove all files that can be recreated from noweb sources. nowebs := $(wildcard *.nw) rem := $(nowebs:.nw=.icn) rem := $(rem) $(nowebs:.nw=.tex) rem := $(rem) $(nowebs:.nw=.log) rem := $(rem) $(nowebs:.nw=.aux) rem := $(rem) $(nowebs:.nw=.toc) clean: -rm -f $(rem)