forked from chromakode/danceparty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
29 lines (21 loc) · 867 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
.PHONY: clean static js less rename
all: static
clean:
rm -f danceparty/static/danceparty.*min.js danceparty/static/danceparty.*css
static: js less rename
js: danceparty/static/danceparty.min.js
define NAME_MANGLE
filename=$(subst %s,.`md5sum $(1) | cut -c 1-10`,$(2)); \
mv $(1) $$filename; \
ln -s `basename $$filename` $(1)
endef
JS_FILES := $(addprefix danceparty/static/lib/, jquery-2.0.3.min.js underscore-1.4.4.js backbone-1.0.0.js gif.js camera.js) danceparty/static/danceparty.js
danceparty/static/danceparty.min.js: $(JS_FILES)
rm -f $@
cat $(JS_FILES) | uglifyjs > $@
$(call NAME_MANGLE,$@,danceparty/static/danceparty%s.min.js)
less: danceparty/static/danceparty.css
danceparty/static/danceparty.css: danceparty/static/dance.less
rm -f $@
lessc danceparty/static/dance.less > $@
$(call NAME_MANGLE,$@,danceparty/static/danceparty%s.css)