]> mj.ucw.cz Git - ucwmac.git/blobdiff - Makefile
Makefile: Compile tests twice to get references right
[ucwmac.git] / Makefile
index f82f86bc2fd99f63a687ad9638c64e8f253ea949..a67bafaf596a8ab0d0d0782b5769ea997020a781 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,9 @@
 VERSION=1.1
 ARCHIVE=ucwmac-$(VERSION).tar.gz
 
-all: test.pdf test-labels.pdf
+all: test.pdf test-labels.pdf test-ref.pdf
+
+MACROS=$(wildcard ucw*.tex)
 
 ifdef USE_LUATEX
 
@@ -9,15 +11,19 @@ LUATEX?=luatex
 export TEXINPUTS=.//:
 export LUAINPUTS=.//:
 
-%.pdf: %.tex ucw-luacsplain.fmt
+%.pdf: %.tex $(MACROS) ucw-luacsplain.fmt
+       $(LUATEX) -file-line-error -fmt ucw-luacsplain $<
        $(LUATEX) -file-line-error -fmt ucw-luacsplain $<
 
 %.fmt: %.ini
        $(LUATEX) -file-line-error -jobname $* -ini $<
 
+.SECONDARY: ucw-luacsplain.fmt
+
 else ifdef USE_DVI
 
-%.dvi: %.tex
+%.dvi: %.tex $(MACROS)
+       csplain -file-line-error $<
        csplain -file-line-error $<
 
 %.pdf: %.dvi
@@ -25,7 +31,8 @@ else ifdef USE_DVI
 
 else
 
-%.pdf: %.tex
+%.pdf: %.tex $(MACROS)
+       pdfcsplain -file-line-error $<
        pdfcsplain -file-line-error $<
 
 endif