Makefile 788 Bytes
Newer Older
1 2 3 4
PDFLATEX		?= pdflatex
XELATEX			?= xelatex
LUALATEX		?= lualatex

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

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

engines			 = pdflatex xelatex lualatex
targets			 = minimal minimal_handout tutorial

14
%/minimal: src
15 16 17
	@mkdir -p $(@D)
	cd $(@D) && $(cmd%$*) ../../minimal/minimal.tex

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

22
%/tutorial: src %/minimal %/minimal_handout
23 24 25 26 27 28 29 30
	@mkdir -p $(@D)
	cd $(@D) && $(cmd%$*) ../../tutorial/tutorial.tex


all: $(engines)

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

31 32 33
src:
	mkdir -p $@
	cd $@ && ln -s ../../*.sty ../../*.pdf .
34 35

clean:
36
	$(RM) -r src
37
	$(RM) -r $(engines)