forked from atomicobject/ICanHandlebarz.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (31 loc) · 1001 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
39
40
41
SHELL = /bin/bash
VERSION = $(shell cat version.txt;)
COMPILER = /usr/share/java/closure-compiler/closure-compiler.jar
ICH = ICanHandlebarz.js
ICH_MIN = ICanHandlebarz.min.js
BASE_FILES = source/handlebars.js \
source/main.js
all: normal min
normal: $(ICH)
min: $(ICH_MIN)
$(ICH): $(BASE_FILES)
@@echo
@@echo "Building" $(ICH) "..."
@@cat source/intro.js | sed -e 's/@VERSION@/$(VERSION)/' > $(ICH)
@@echo "(function ($$) {" >> $(ICH)
@@cat $(BASE_FILES) | sed -e 's/@VERSION@/$(VERSION)/' >> $(ICH)
@@echo "})(window.jQuery || window.Zepto);" >> $(ICH)
@@echo $(ICH) "built."
@@echo
$(ICH_MIN): $(ICH)
@@echo
@@echo "Building" $(ICH_MIN) "..."
ifdef COMPILER
@@java -jar $(COMPILER) --compilation_level SIMPLE_OPTIMIZATIONS --js=$(ICH) > $(ICH_MIN)
@@echo $(ICH_MIN) "built."
else
@@echo $(ICH_MIN) "not built."
@@echo " Google Closure complier required to build minified version."
@@echo " Please point COMPILER variable in 'makefile' to the jar file."
endif
@@echo