LATEX = latex PDFLATEX = pdflatex RM = rm DVIPS = dvips TANGLE = notangle WEAVE = noweave RUN_LISP = clisp -i max # need to be in order for html generation (see target max.html) INPUT_FILES = max.nw test.nw type.nw object.nw function.nw ptr.nw boolean.nw set.nw string.nw eval.nw catalog.nw menu.nw name.nw repl.nw adventure.nw util.nw LISP_FILES = $(INPUT_FILES:.nw=.lisp) TEX_FILES = $(INPUT_FILES:.nw=.tex) AUX_FILES = $(TEX_FILES:.tex=.aux) OUTPUTS = $(LISP_FILES) max.dvi max.ps max.pdf max.html TEXJUNK = $(TEX_FILES) $(AUX_FILES) texput.log max.toc max.log max.out .PHONY: all clean auxclean doc run ps pdf html all: $(LISP_FILES) clean: $(RM) -f $(OUTPUTS) $(TEXJUNK) auxclean: $(RM) -f $(AUX_FILES) texclean: $(RM) -f $(TEXJUNK) doc: ps pdf html run: $(LISP_FILES) $(RUN_LISP) ps: max.ps pdf: max.pdf html: max.html # This is the main tex file that includes the other ones # so it needs headers and footers (either defined in it, or added by # noweb by not specifying -n) max.tex: max.nw $(WEAVE) -delay -index $< > $@ # The main dvi file is made of multiple \include'd tex files # Run LaTeX thrice for correct cross references. max.dvi: $(TEX_FILES) $(LATEX) max.tex $(LATEX) max.tex $(LATEX) max.tex # auxclean: If the .aux files left over from latex are here, pdflatex has an error max.pdf: $(TEX_FILES) auxclean $(PDFLATEX) max.tex $(PDFLATEX) max.tex $(PDFLATEX) max.tex max.html: $(INPUT_FILES) $(WEAVE) -html -filter l2h -index $^ |htmltoc -1234 > $@ # (Don't) Keep these auto-created files around #.SECONDARY: $(TEX_FILES) # $(DVI_FILES) # -n: Don't include TeX headers and footers, since # we're going to \include these .tex files. %.tex: %.nw $(WEAVE) -n -index $< > $@ %.lisp: %.nw $(TANGLE) -R$* $< > $@ %.ps: %.dvi $(DVIPS) $<