forked from sergiokas/Extensity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (29 loc) · 910 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
# Primitive makefile for including just required files in the distribution.
# @requires jsmin (http://www.crockford.com/javascript/jsmin.html)
# @requires zip
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=csso
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/$@.minify
mv $(DIST)/js/$@.minify $(DIST)/js/$@
%.css:
cat $(DIST)/styles/$@ | $(CSSMIN) > $(DIST)/styles/$@.minify
mv $(DIST)/styles/$@.minify $(DIST)/styles/$@
pack:
@echo "### Packing..."
find $(DIST) -name '.DS_Store' | xargs rm
cd $(DIST); zip -r dist.zip *
clean:
rm -rf $(DIST)
mkdir dist