Skip to content

Commit 28d926f

Browse files
committed
Clean up make workflow
1 parent 51c78ec commit 28d926f

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,4 @@ TSWLatexianTemp*
189189
## Generated LaTeX files:
190190
*.tex
191191
!book.tex
192+
src/auto/

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ PKG := software_foundations
22
# TODO: Find idris executable.
33
IDRIS ?= idris
44

5+
.PHONY: pdf site
6+
57
all: pdf site
68

79
build:
810
$(IDRIS) --build $(PKG).ipkg
911

1012
pdf:
11-
$(MAKE) -C src all
12-
$(MAKE) -C src all.pdf
13+
$(MAKE) -C src
1314
mv src/all.pdf docs/pdf/sf-idris-2016.pdf
1415

1516
clean-all: clean clean-docs

src/Makefile

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,32 @@
1-
.DEFAULT_GOAL := all
1+
.DEFAULT_GOAL := all.pdf
22

33
# TODO: Find pandoc executable.
44
PANDOC ?= pandoc
55

6+
PANDOC_FLAGS := \
7+
--filter pandoc-minted.hs --latex-engine=xelatex \
8+
-f markdown+lhs+tex_math_single_backslash -t latex+lhs \
9+
--top-level-division=chapter
10+
611
LIDRFILES := Preface.lidr \
712
Basics.lidr \
813
Induction.lidr
914
# TODO: Add more chapters, in order, here.
1015

1116
TEXFILES := $(LIDRFILES:.lidr=.tex)
1217

13-
.PHONY: clean
1418

15-
all: all.pdf
19+
.PHONY: all clean
1620

1721
clean:
1822
rm -rf all.{aux,log,out,toc,pdf} _minted-all $(TEXFILES)
1923

2024
all.pdf: all.tex
21-
xelatex -shell-escape $<
22-
xelatex -shell-escape $<
25+
latexmk -xelatex -e '$$pdflatex=q/xelatex %O --shell-escape %S/' $<
2326

2427
all.tex: book.tex $(TEXFILES)
25-
$(PANDOC) --filter pandoc-minted.py --latex-engine=xelatex \
26-
-f markdown+lhs+tex_math_single_backslash -t latex+lhs \
27-
--top-level-division=chapter -N \
28-
--toc \
29-
-o $@ $(foreach tex,$(filter-out $<,$^),-A $(tex)) \
30-
book.tex
28+
$(PANDOC) $(PANDOC_FLAGS) -N --toc -o $@ \
29+
$(foreach texfile,$(TEXFILES),-A $(texfile)) $<
3130

3231
%.tex: %.lidr
33-
$(PANDOC) --filter pandoc-minted.py --latex-engine=xelatex \
34-
-f markdown+lhs+tex_math_single_backslash -t latex+lhs \
35-
--top-level-division=chapter -N \
36-
-o $@ $<
32+
$(PANDOC) $(PANDOC_FLAGS) -o $@ $<

0 commit comments

Comments
 (0)