preserver latexmk's exit status
[latexmk-quieter.git] / Makefile.example
blob5aa4e2658c43591788c04203977409b14ee4745b
1 LATEXMK ?= latexmk-quieter latexmk --outdir=outdir --pdf --pdflatex="pdflatex -halt-on-error"
3 FIGURE_FILES := $(wildcard fig*.tex)
4 MAIN_FILES := $(filter-out $(FIGURE_FILES),$(wildcard *.tex))
5 MAIN_PDFS := $(patsubst %.tex,%.pdf,$(MAIN_FILES))
6 FIGURE_PDFS := $(patsubst %.tex,%.pdf,$(FIGURE_FILES))
8 default: all
9 all: $(MAIN_PDFS)
10 clean:
11         @rm -rf outdir
12         @rm -f *pdf
14 MAYBE_BIB := 
15 MAYBE_BIB+= $(wildcard ../bib.bib)
16 MAYBE_BIB+= $(wildcard bib.bib)
18 $(MAIN_PDFS): $(MAYBE_BIB) $(FIGURE_PDFS)
20 %.pdf: %.tex
21         $(LATEXMK) $<
22         @mv outdir/$*.pdf . 2>/dev/null
23         @pkill -SIGHUP mupdf 2>/dev/null || true