-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
108 lines (81 loc) · 2.52 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Configuration
SHELL = zsh
INFRASTRUCTURE = $(shell which pandoc || echo /usr/local/bin/pandoc)
DIRECTORIES = output
HTML_TEMPLATE = website/template.html
YEAR = 2020
USERNAME = $(shell git config --get user.name)
EMAIL = $(shell git config --get user.email)
# Default Target (must appear before rules for output files)
all:
# Output Files and Their Dependencies
OUTPUTS = \
.htaccess \
index.html \
call.html \
organization.html \
program.html \
keynote.html \
invited_talk.html \
past.html \
index.css \
montreal.jpeg \
attendees.jpeg \
bonita.png \
davide.png \
davide.jpeg \
giuseppe.png \
hidetake.jpg \
hidetake.png \
robert.png \
preprint-paper8.pdf \
preprint-livestudy.pdf \
SEmotion20.pdf \
seoul.jpeg
output/index.html: website/index.md
output/call.html: website/call.md
output/organization.html: website/organization.md
output/program.html: website/program.md
output/keynote.html: website/keynote.md
output/invited_talk.html: website/invited_talk.md
output/past.html: website/past.md
SEmotion20.pdf: website/SEmotion20.pdf
# Targets
.PHONY: all deploy clean
all: $(OUTPUTS:%=output/%)
deploy: all
(cd output; rm -rf .clone .git)
(cd output; git clone -q "https://github.com/SEmotion/$(YEAR)" .clone)
(cd output; mv .clone/.git ./)
(cd output; rm -rf .clone)
(cd output; git config --local user.name "$(USERNAME)")
(cd output; git config --local user.email "$(EMAIL)")
(cd output; git add .)
(cd output; git commit -m "Published snapshot as of $$(date +'%Y-%m-%d')." || true)
(cd output; git push)
(cd output; rm -rf .git)
clean:
-rm -rf output/.git
-rm -r $(DIRECTORIES)
# Acircularity Rules
$(HTML_TEMPLATE):
true
# Infrastructural Rules
$(INFRASTRUCTURE):
@echo 'This Makefile depends on PanDoc, which was not found; please install it.'
false
$(DIRECTORIES):
mkdir -p "$@"
# Other Rules
output/.htaccess: website/.htaccess | $(DIRECTORIES)
cp website/.htaccess "$@"
output/%.html: $(INFRASTRUCTURE) $(HTML_TEMPLATE) | $(DIRECTORIES)
pandoc --from markdown+fancy_lists+multiline_tables --to html5 --template $(HTML_TEMPLATE) --metadata lang=en --metadata title=ignored --variable page-$(@:output/%.html=%):"selected" --output "$@" $(filter %.md,$^)
output/%.css: website/%.css | $(DIRECTORIES)
cp $(@:output/%.css=website/%.css) "$@"
output/%.png: website/%.png | $(DIRECTORIES)
cp $(@:output/%.png=website/%.png) "$@"
output/%.jpeg: website/%.jpeg | $(DIRECTORIES)
cp $(@:output/%.jpeg=website/%.jpeg) "$@"
output/%.pdf: website/%.pdf | $(DIRECTORIES)
cp $(@:output/%.pdf=website/%.pdf) "$@"