-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathMakefile
34 lines (27 loc) · 854 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
# Primitive makefile for including just required files in the distribution.
FILES=index.html options.html profiles.html manifest.json
DIRS=images styles js fonts
DIST=dist
JS=engine.js index.js options.js profiles.js migration.js
CSS=index.css options.css normalize.css
JSMIN=uglifyjs --compress --mangle
CSSMIN=sass --stdin --style=compressed
dist: clean copy minify pack
copy:
@echo "### Copying files"
cp -R $(DIRS) $(FILES) $(DIST)
minify: $(JS) $(CSS)
@echo "### Minification complete"
%.js:
cat $(DIST)/js/$@ | $(JSMIN) > $(DIST)/js/[email protected]
mv $(DIST)/js/[email protected] $(DIST)/js/$@
%.css:
cat $(DIST)/styles/$@ | $(CSSMIN) > $(DIST)/styles/[email protected]
mv $(DIST)/styles/[email protected] $(DIST)/styles/$@
pack:
@echo "### Packing..."
find $(DIST) -name '.DS_Store' | xargs rm
cd $(DIST); zip -r dist.zip *
clean:
rm -rf $(DIST)
mkdir dist