-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile
93 lines (63 loc) · 2.2 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
PANDOC=pandoc
ROOT="/research-computing-with-cpp/"
PANDOCARGS=-t revealjs -s -V theme=night --css=http://lab.hakim.se/reveal-js/css/theme/night.css \
--css=$(ROOT)/css/ucl_reveal.css --css=$(ROOT)/site-styles/reveal.css \
-V width:'"100%"' -V height:'"100%"' -V margin:0 -V minScale:0.1 -V maxScale:1.5 \
--default-image-extension=png --highlight-style=zenburn --mathjax -V revealjs-url=http://lab.hakim.se/reveal-js
MDS=$(filter-out _site%, $(wildcard 01research/*.md 02cpp1/index.md 02cpp1/sec01*.md 02cpp1/sec02*.md 02cpp1/sec03EssentialReading-reveal.md 03cpp2/*.md 04cpp3/*.md ))
TEMPLATED=$(MDS:.md=.tmd)
RELATIVE=$(MDS:.md=.rmd)
SLIDES=$(MDS:.md=-reveal.html)
EXES=$(shell find build -type f \( -perm -u=x -o -perm -g=x -o -perm -o=x \) -name *.x)
PY_FIGURE_SOURCES= $(shell find 06MPI/figures -name *.py)
PY_FIGURES=$(PY_FIGURE_SOURCES:.py=.png)
vpath %.x build
OUTS=$(subst build/,,$(EXES:.x=.out))
default: _site
.DELETE_ON_ERROR:
%.out: %.x Makefile
$< > $@
%-reveal.html: %.rmd Makefile
cat $< | $(PANDOC) $(PANDOCARGS) -o $@
%.png: %.py Makefile
python $< $@
%.png: %.nto Makefile
neato $< -T png -o $@
%.png: %.dot Makefile
dot $< -T png -o $@
%.png: %.uml Makefile
java -Djava.awt.headless=true -jar plantuml.jar -p < $< > $@
notes.pdf: combined.md Makefile $(PY_FIGURES)
$(PANDOC) -Vdocumentclass=report --toc --from markdown combined.md -o notes.pdf
%.tmd: %.md liquify.rb _plugins/idio.rb Makefile
bundle exec ruby liquify.rb $< > $@
%.rmd: %.md liquify.rb _plugins/idio.rb Makefile
bundle exec ruby liquify.rb $< slides > $@
combined.md: $(TEMPLATED) cover.md
cat cover.md `echo $^ | sed s/cover.md// ` > $@
notes.tex: combined.md Makefile $(OUTS)
$(PANDOC) --from markdown combined.md -o notes.tex
master.zip: Makefile
rm -f master.zip
ready: $(OUTS) notes.pdf $(SLIDES) notes.tex $(PY_FIGURES)
.PHONY: ready
_site: ready _plugins/idio.rb
jekyll build --verbose
preview: ready
jekyll serve --verbose
clean:
rm -rf build
rm -f master.zip
rm -f notes.pdf
rm -rf _site
rm -f favicon*
rm -f combined*
rm -rf _includes
rm -rf _layouts
rm -rf js
rm -rf images
rm -f */*.tmd
rm -f */*.rmd
rm -f */*.slide.html
rm -f */*-reveal.html
rm -rf css