From: Mark Wooding Date: Sat, 5 Sep 2020 13:41:42 +0000 (+0100) Subject: Makefile.m4: Format each document in a subdirectory. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mdwtools/commitdiff_plain/68953aceca98eea0dbd07cfab4562990aae15997 Makefile.m4: Format each document in a subdirectory. The recent change f76fbef37b2af3292764729f496f578037cdc314 to `sverb.dtx' prevents parallel formatting of /different/ documents from interfering with each other, but I want to build PDF documents using PDFTeX rather than going via `dvips' and `ps2pdf', and the two parallel builds of the /same/ documents will still have the same `\jobname' and therefore will fight over all kinds of temporary files -- not just the demo files, but `.aux', `.toc', and everything. --- diff --git a/Makefile.m4 b/Makefile.m4 index a9b2f9e..6df673e 100644 --- a/Makefile.m4 +++ b/Makefile.m4 @@ -62,15 +62,20 @@ pkglatex_DATA = $(OBJ) mdwtools.tex pkgdoc_DATA = $(DVI) $(PS) $(PDF) SUFFIXES = .dtx .tex .dvi .ps -define(`run_latex', `latex "\def\indexing{n} \nonstopmode \input $<" - latex "\def\indexing{y} \nonstopmode \input $<" - makeindex -s gind.ist $`'*.idx - latex "\def\indexing{n} \nonstopmode \input $<"') +define(`run_latex', `rm -rf t.$`'@/ && mkdir t.$`'@/ && \ + cd t.$`'@/ && \ + TEXINPUTS=..:$$TEXINPUTS && export TEXINPUTS && \ + latex "\def\indexing{n} \nonstopmode \input $<" && \ + latex "\def\indexing{y} \nonstopmode \input $<" && \ + makeindex -s gind.ist $`'*.idx && \ + latex "\def\indexing{n} \nonstopmode \input $<" && \ + mv $`'@ ../ && cd ../ && rm -rf t.$`'@/') .dtx.dvi:; run_latex .tex.dvi:; run_latex .dvi.ps:; dvips -e0 -o $@ $< .ps.pdf:; ps2pdf $< $@ +clean-local::; rm -rf t.*/ $(DVI): gpl.tex $(OBJ) mdwtools.tex