forked from Twipped/Kalendae
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (45 loc) · 1.19 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
UGLIFYJS=$(shell which uglifyjs)
kal=src/main.js \
src/util.js \
src/auto.js \
src/input.js \
src/MinPubSub.js \
src/moment.js \
src/moment.ext.js \
src/jq.js
all: build/kalendae.js
clean:
rm -f build/*.js
minified: build/kalendae.min.js
minified-test: build/kalendae.min.errors
build/kalendae.js: $(kal)
cat src/header.js >> $@
echo "(function (undefined) {" >> $@
echo "" >> $@
cat $(kal) >> $@
echo "" >> $@
echo "})();" >> $@
build/kalendae.min.js: build/kalendae.js
cat src/header.js >> $@
ifneq ($(UGLIFYJS), "")
$(UGLIFYJS) build/kalendae.js >> $@
else
curl -s \
--data-urlencode 'js_code@build/kalendae.js' \
--data-urlencode 'output_format=text' \
--data-urlencode 'output_info=compiled_code' \
#--data-urlencode 'compilation_level=ADVANCED_OPTIMIZATIONS' \
http://closure-compiler.appspot.com/compile \
>> $@
endif
gzip -c build/kalendae.min.js | wc -c
build/kalendae.min.errors: build/kalendae.js
ifneq ($(UGLIFYJS), "")
$(UGLIFYJS) build/kalendae.js 1>/dev/null
else
curl -s \
--data-urlencode 'js_code@build/kalendae.js' \
--data-urlencode 'output_format=text' \
--data-urlencode 'output_info=errors' \
http://closure-compiler.appspot.com/compile
endif