summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/lualatex/lualatex-doc/Makefile
blob: f2778000a56dbebf2af5f2da74551bc3f585cfa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
NAME   = lualatex-doc
FORMAT = lualatex

DOC    = $(NAME).pdf
SRC    = $(NAME).tex
README = README
MKD    = $(README).markdown

SRCFILES  = $(SRC) Makefile lltxdoc.cls
DOCFILES  = $(DOC) $(README) News
ALL       = $(SRCFILES) $(DOCFILES)

GENERATED = $(DOC) $(README)

all: lualatex-doc.pdf
world: all ctan

.PHONY: all world

# (with the next version of latexmk: -pdf -pdflatex=lualatex)
LATEXMK_FMT = -pdf -e '$$pdflatex = q(lualatex %O %S)'

%.pdf: %.tex
	latexmk -silent $(LATEXMK_FMT) $< >/dev/null

$(README): $(MKD)
	@cp $(MKD) $(README)

ctan: $(NAME).tds.zip
	@zip -q $(NAME).zip $(ALL) $(NAME).tds.zip

$(NAME).tds.zip -q: $(ALL)
	@rm -rf texmf
	@mkdir -p texmf/doc/$(FORMAT)/$(NAME)
	@cp $(DOCFILES) texmf/doc/$(FORMAT)/$(NAME)
	@mkdir -p texmf/source/$(FORMAT)/$(NAME)
	@cp $(SRCFILES) texmf/source/$(FORMAT)/$(NAME)
	@cd texmf && zip -q -r ../$(NAME).tds.zip .
	@rm -rf texmf

.PHONY: clean mrproper

clean:
	@latexmk -silent -c >/dev/null

mrproper: clean
	@rm -f -- $(GENERATED) $(NAME)*.zip