Makefile 1.01 KB
Newer Older
1 2 3 4
PDFLATEX		?= pdflatex
XELATEX			?= xelatex
LUALATEX		?= lualatex

5
export TEXINPUTS	:= $(CURDIR)/src//:$(TEXINPUTS)
6 7 8 9 10 11

cmd%pdflatex		 = $(PDFLATEX)
cmd%xelatex		 = $(XELATEX)
cmd%lualatex		 = $(LUALATEX)

engines			 = pdflatex xelatex lualatex
12
targets			 = minimal minimal_handout tutorial many-pages
13

14
%/minimal: src
15
	@mkdir -p $(@D)
16
	cd $(@D) && $(cmd%$*) -halt-on-error -interaction=nonstopmode ../../minimal/minimal.tex
17

18
%/minimal_handout: src
19
	@mkdir -p $(@D)
20
	cd $(@D) && $(cmd%$*) -halt-on-error -interaction=nonstopmode ../../minimal/minimal_handout.tex
21

22
%/tutorial: src %/minimal %/minimal_handout
23
	@mkdir -p $(@D)
24
	cd $(@D) && $(cmd%$*) -halt-on-error -interaction=nonstopmode ../../tutorial/tutorial.tex
25

26 27
%/many-pages: src
	@mkdir -p $(@D)
28
	cd $(@D) && $(cmd%$*) -halt-on-error -interaction=nonstopmode ../many-pages.tex
29 30 31 32 33

all: $(engines)

$(foreach engine,$(engines),$(eval $(engine): $(patsubst %,$(engine)/%,$(targets))))

34 35 36
src:
	mkdir -p $@
	cd $@ && ln -s ../../*.sty ../../*.pdf .
37 38

clean:
39
	$(RM) -r src
40
	$(RM) -r $(engines)