forked from mickmcq/iste422book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (47 loc) · 1.66 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
rerun = "Rerun to get cross-references right"
basename = book
latex = xelatex
option = -interaction=nonstopmode -halt-on-error -jobname $(basename) '\input{preamble-basic.tex}'
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
DOCKER_IMAGE = iste-book:latest
# Uncomment to specify x86 if necessary for pandoc image
DOCKER_PLATFORM = # '--platform linux/amd64'
all : $(basename).pdf
$(basename).pdf : $(basename).tex
$(latex) $(option) || true
grep -q $(rerun) $(basename).log \
&& $(latex) $(option) \
|| true
$(basename).tex : $(basename)-content.md
pandoc \
-s \
-t latex \
--bibliography $(basename).bib \
--template pandocNotes \
$(basename)-content.md \
-o $(basename).tex
$(basename)-content.md : 0*.md 1*.md
cat \
01intro-content.md \
02develMeth-content.md \
03diagrams-content.md \
04versionCtrl-content.md \
05buildUtil-content.md \
06testing-content.md \
07errors-content.md \
08generic-content.md \
09reverse-content.md \
10efficient-content.md \
12applDeploy-content.md \
13help-content.md \
14packaging-content.md \
15doc-content.md \
16appendices-content.md \
> $(basename)-content.md
clean :
rm -f $(basename)-content.md *.log *.aux *.out *.fls *.toc *~
docker-all: docker-build docker-run
docker-run:
docker run -v $(ROOT_DIR):/data -t --rm $(DOCKER_IMAGE) all
docker-build:
docker build -t $(DOCKER_PLATFORM) $(DOCKER_IMAGE) .