-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (28 loc) · 914 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
SASS = node_modules/node-sass/bin/node-sass
BROWSERIFY = node_modules/browserify/bin/cmd.js
UGLIFY = node_modules/uglify-js/bin/uglifyjs
STANDARD = node_modules/.bin/standard
CSS += node_modules/normalize-css/normalize.css
CSS += node_modules/codemirror/lib/codemirror.css
CSS += node_modules/codemirror/theme/monokai.css
SCSS != find scss -name '*.scss'
all: css/main.css js/main.js
lint:
$(STANDARD) src/main.js
pages: all
if [ ! -d $@ ]; then \
git clone -b gh-pages "$$(git config --get remote.origin.url)" $@; \
fi
git -C $@ pull
cp -R css js index.html $@
git -C $@ add .
if git -C $@ status --porcelain | grep -q '^[AM]'; then \
git -C $@ commit -m 'Update'; \
git -C $@ push; \
fi
css/main.css: $(CSS) $(SCSS) css
(cat $(CSS); $(SASS) --stdout scss/main.scss) | $(SASS) --output-style compressed > $@
js/main.js: src/main.js js
$(BROWSERIFY) $< | $(UGLIFY) > $@
css js:
mkdir $@