-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
39 lines (29 loc) · 895 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
37
38
39
ifeq ($(shell uname -s), Darwin)
OPEN='open'
else
OPEN='see'
endif
ABAKUS=abakus-statutter
# Used to check if any of the tex files have been changed
all: $(ABAKUS).pdf
test: clean all jekyll
%.pdf: %.tex
@ mkdir -p logs
@ latexmk -pdf $< >> logs/compile \
&& echo "Compiled $@" || (cat logs/compile && fail)
$(ABAKUS).tex: $(ABAKUS)/*.tex
@touch $@
open: $(ABAKUS).pdf
$(OPEN) $(ABAKUS).pdf
clean:
rm -f *.log *.aux *.lof *.pdf *.toc *.lot *.out *.fdb_latexmk *.fls
rm -rf logs
rm -f gh-pages/index.html gh-pages/*.pdf
jekyll: clean gh-pages/index.html gh-pages/$(ABAKUS).pdf
gh-pages/index.html: $(ABAKUS).tex
@echo "---\nlayout: abakus\ntitle: Abakus' statutter\n---" > gh-pages/index.html
@pandoc --filter pandoc-section-links -f latex -t html $(ABAKUS)/innhold.tex >> gh-pages/index.html
@echo "Created $@"
gh-pages/%.pdf: %.pdf
cp $< $@
.PHONY: open clean jekyll