forked from sdiehl/wiwinwlh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (28 loc) · 854 Bytes
/
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
PANDOC = pandoc
IFORMAT = markdown
TEMPLATE = resources/page.tmpl
LTEMPLATE = resources/page.latex
ETEMPLATE = resources/page.epubt
FLAGS = --standalone \
--toc \
--toc-depth=2 \
--highlight-style pygments \
-c css/style.css \
-c css/layout.css
GHC=ghc
HTML = tutorial.html
# Check if sandbox exists. If it does, then use it instead.
all: $(HTML)
includes: includes.hs
$(GHC) --make $< ; \
%.html: %.md includes
./includes < $< \
| $(PANDOC) --template $(TEMPLATE) -s -f $(IFORMAT) -t html $(FLAGS) \
| sed '/<extensions>/r extensions.html' > $@
%.epub: %.md includes
(cat $(ETEMPLATE); ./includes < $<) \
| $(PANDOC) -f $(IFORMAT) -t epub $(FLAGS) -o $@
%.pdf: %.md includes
./includes < $< | $(PANDOC) -c -s -f $(IFORMAT) --template $(LTEMPLATE) --latex-engine=xelatex $(FLAGS) -o $@
clean:
-rm $(CHAPTERS) $(HTML)