-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
208 lines (159 loc) · 6.09 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
.PHONY: default-rule
default-rule: .merlin .ocamlinit site
include $(shell opam config var solvuu-build:lib)/solvuu.mk
PRODUCTION=false
# Paths to local executables.
babel=node_modules/.bin/babel
browserify=node_modules/.bin/browserify
node-sass=node_modules/.bin/node-sass
postcss=node_modules/.bin/postcss
cufp.org=./cufp.org
################################################################################
# CSS
site/css/app.css: $(wildcard site/css/*.scss) \
_cache/foundation-icons \
node_modules/autoprefixer \
node_modules/foundation-sites \
node_modules/motion-ui \
node_modules/node-sass \
node_modules/postcss-cli \
etc/autoprefixer-config.json
$(node-sass) --include-path node_modules/foundation-sites/scss \
--include-path node_modules/motion-ui/dist \
site/css/app.scss > $@ || rm -f $@
$(postcss) --use autoprefixer \
--local-plugins \
-c etc/autoprefixer-config.json \
-d site/css $@
# See changes we've made to Foundation settings.
.PHONY: diff-foundation-settings
diff-foundation-settings: node_modules/foundation-sites
diff \
node_modules/foundation-sites/scss/settings/_settings.scss \
site/css/_settings.scss
################################################################################
# JavaScript
site/js/app.min.js: site/js/app.js \
site/js/_functions.js \
node_modules/babel-cli \
node_modules/foundation-sites
$(babel) -o $@ --minified \
node_modules/foundation-sites/dist/plugins/foundation.core.js \
node_modules/foundation-sites/dist/plugins/foundation.util.mediaQuery.js \
site/js/_functions.js \
site/js/app.js
################################################################################
# OCaml
_build/app/cufp.org.byte: FORCE
$(OCAMLBUILD) app/cufp.org.byte
_build/app/cufp.org.native: FORCE
$(OCAMLBUILD) app/cufp.org.native
_build/app/cufp.org: _build/app/cufp.org.byte
cp -f $< $@
$(cufp.org): _build/app/cufp.org.byte
cp -f $< $@
################################################################################
# 3rd Party Packages
_cache/foundation-icons: | _cache
wget -O _cache/foundation-icons.zip http://zurb.com/playground/uploads/upload/upload/288/foundation-icons.zip
unzip -q -o -d _cache _cache/foundation-icons.zip
rm -rf _cache/__MACOSX
node_modules/autoprefixer:
npm install autoprefixer
node_modules/babel-cli:
npm install babel-cli
node_module/browserify:
npm install browserify
node_modules/foundation-sites:
npm install foundation-sites@6.2.3
node_modules/motion-ui:
npm install motion-ui@1.2.2
node_modules/node-sass:
npm install node-sass
node_modules/postcss-cli:
npm install postcss-cli
################################################################################
# Build Site
# General markdown files.
markdown-bases=site/about.md site/bylaws.md site/license.md \
site/steering-committee.md \
$(patsubst %, site/%/call-for-presentations.md, 2016 2017) \
$(patsubst %, site/%/call-for-tutorials.md, 2016 2017)
$(patsubst %.md, _build/%.html, $(markdown-bases)): _build/site/%.html: site/%.md | _build/tmp
$(cufp.org) build markdown -production $(PRODUCTION) $<
# Blog RSS feed.
_build/site/blog/all.rss.xml: site/blog/all.rss.xml | _build/site/blog
cp -f $< $@
# robots.txt
_build/site/robots.txt:
$(cufp.org) build robots -production $(PRODUCTION) >| $@
years_2009-2015=2009 2010 2011 2012 2013 2014 2015
$(patsubst %, _build/site/%, $(years_2009-2015)): _build/site/%: site/%
rsync -a $</*.html $@/
_build/site/2016/index.html: site/2016/* | _build/tmp
$(cufp.org) build html -production $(PRODUCTION) site/2016/index.html
_build/site/2016: site/2016 _build/site/2016/index.html
$(cufp.org) build events 2016 \
-background img/photo-1461727885569-b2ddec0c4328.jpeg \
-production $(PRODUCTION)
_build/site/2017/index.html: site/2017/* | _build/tmp
$(cufp.org) build html -production $(PRODUCTION) site/2017/index.html
_build/site/2017: site/2017 _build/site/2017/index.html
$(cufp.org) build events 2017 \
-background img/13164220234_91e79f4575_z.jpg \
-production $(PRODUCTION)
.PHONY: site
site: $(cufp.org) \
_build/app/cufp.org \
site/css/app.css \
site/js/app.min.js \
_cache/foundation-icons \
$(patsubst %.md, _build/%.html, $(markdown-bases)) \
$(patsubst %, _build/%, $(html-files)) \
_build/site/blog/all.rss.xml \
_build/site/robots.txt \
$(patsubst %, _build/site/%, $(years_2009-2015)) \
$(patsubst %, _build/site/%, 2016 2017) \
| _build/site/css _build/site/js _build/tmp
cp -f site/css/app.css _build/site/css/
cp -f site/js/app.min.js _build/site/js
rsync -a --exclude=foundation-icons.css --exclude=preview.html _cache/foundation-icons/ _build/site/css/
cp -f site/index.html _build/site/
rsync -a --exclude=/icon/ ../cufp.org-media/* _build/site/
cp -f ../cufp.org-media/icon/favicon-32x32.png _build/site/
rsync -a site/200[4-8] site/conference _build/site/
rsync -a site/201[4-7]cfp _build/site/
rsync -a --exclude=/index.html site/videos/ _build/site/videos/
################################################################################
# Empty directories, used as order-only prerequisites
_cache:
mkdir $@
_build:
mkdir $@
_build/site: | _build
mkdir $@
_build/site/js: | _build/site
mkdir $@
_build/site/css: | _build/site
mkdir $@
_build/site/blog: | _build/site
mkdir $@
_build/tmp: | _build
mkdir $@
################################################################################
# Clean Up
clean-site:
rm -rf _build/site
clean:
ocamlbuild -clean
rm -f $(cufp.org)
rm -rf site/css/.sass-cache
clean-cache:
rm -rf _cache
rm -rf node_modules
distclean: clean clean-cache
clean-everything: distclean
rm -f site/css/cufp.css
rm -f site/js/app.min.js
# Don't delete this. It is a trick to make ocamlbuild always run. See above.
FORCE: