-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (26 loc) · 713 Bytes
/
Makefile
File metadata and controls
40 lines (26 loc) · 713 Bytes
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
DOCS =
tex_files = $(wildcard *.tex)
svg_files = $(wildcard *.svg)
output = $(DOCS:.tex=.pdf)
inclusions = $(filter-out $(DOCS), $(tex_files))
define graphics
$(1)_graphics = $$(svg_files:.svg=.$(strip $(1)))
$(1): $$($(strip $(1))_graphics);
.PHONY: $1
$$($(strip $(1))_graphics): %.$(strip $(1)):%.svg
inkscape -z --export-$(strip $(1))=$$@ $$<
endef
all: $(output) $(png_graphics);
$(eval $(call graphics, png))
$(eval $(call graphics, pdf))
$(output): %.pdf:%.tex $(inclusions) $(pdf_graphics)
pdflatex $<
$(output): %.pdf:%.out
$(DOCS:.tex=.out): %.out:%.tex $(inclusions)
pdflatex $<
clean:
-rm $(png_graphics)
-rm $(pdf_graphics)
-rm $(output)
-rm *.aux *.out *.log
.PHONY: all clean