-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (28 loc) · 1.04 KB
/
Makefile
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
AGDA=agda
SOURCE=Presentation
LATEXDIR=latex
LATEX=latexmk -recorder -xelatex -interaction=nonstopmode
LATEXCLEAN=latexmk -c
CLEANFILES=$(SOURCE).agdai texput.log $(LATEXDIR)/$(SOURCE).{nav,snm,bbl,ptb,sh,stderr,stdout} $(LATEXDIR)/gitinfo.tex
.PHONY: all
all: $(LATEXDIR)/$(SOURCE).pdf
.PHONY: $(LATEXDIR)/$(SOURCE).pdf
$(LATEXDIR)/$(SOURCE).pdf: $(LATEXDIR)/$(SOURCE).tex
cd $(LATEXDIR) && \
$(LATEX) $(SOURCE).tex
$(LATEXDIR)/$(SOURCE).tex: $(SOURCE).lagda
$(AGDA) --latex --latex-dir=$(LATEXDIR) $(SOURCE).lagda
# Note: Neither clean nor mrproper touch the agda.sty generated by Agda
# in $(LATEXDIR), in case you want to customise it.
.PHONY: clean
clean:
rm -f $(CLEANFILES) && \
cd $(LATEXDIR) && \
([ ! -f $(SOURCE).tex ] || $(LATEXCLEAN) $(SOURCE).tex) && \
rm -f $(SOURCE).tex
.PHONY: mrproper
mrproper: clean
rm -f $(LATEXDIR)/$(SOURCE).{xdv,pdf}
# Generate the example image for this repo, using ImageMagick
presentation.png: $(LATEXDIR)/$(SOURCE).pdf
gs -dSAFER -r600 -sDEVICE=pngalpha -o presentation.png $(LATEXDIR)/$(SOURCE).pdf