-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
56 lines (40 loc) · 1.16 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
NPMBIN=./node_modules/.bin
SVGO=${NPMBIN}/svgo
JADE=${NPMBIN}/jade
JSONSTREAM=${NPMBIN}/JSONStream
CSSNEXT=${NPMBIN}/cssnext
SESSIONS_URL=http://lanyrd.com/2015/campjsnews/schedule/481ea3897063c7d5.v1.json
jade_files = $(patsubst %.jade,%.html,$(subst src/,,$(wildcard src/*.jade)))
svgs = $(filter-out isologo.svg,$(subst src/svg/,,$(wildcard src/svg/*.svg)))
default: images css pages
pages: clean_pages sessions.json $(jade_files)
css: clean_css style.css
style.css:
@${CSSNEXT} src/css/style.css > style.css
@echo "built style.css"
svg: $(svgs)
@${SVGO} --config=./.svgo.yml -i - -o - < src/svg/isologo.svg > src/images/isologo.svg
@cp src/images/* images/
images: svg
@cp src/images/* images/
$(jade_files):
@node makepage.js src/$(patsubst %.html,%.jade,$@) > $@
@echo "built $@"
prepare: node_modules
@mkdir -p images
sessions.json:
curl -s ${SESSIONS_URL} > sessions.json
node_modules:
@npm install
$(svgs): prepare
@${SVGO} -i - -o - < src/svg/$@ > src/images/$@
@echo "built $@"
clean: clean_images clean_css clean_pages
@rm -rf pagedata/
@rm sessions.json
clean_images:
@rm -rf images/
clean_css:
@rm -f style.css
clean_pages:
@rm -f *.html