forked from HenrikJoreteg/ICanHaz.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (29 loc) · 902 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
SHELL = /bin/bash
#VERSION =`git rev-list HEAD -n1`
VERSION = $(shell if [ -f version.txt ]; then cat version.txt; else VERSION=`git rev-list HEAD -n1`; echo $${VERSION:0:7}; fi)
LIBS = js/libs
#YUI_COMPRESSOR = /usr/local/bin/yuicompressor-2.4.2.jar
ICH = ICanHaz.js
ICH_MIN = ICanHaz.min.js
BASE_FILES = source.js
all: normal min
normal: $(ICH)
min: $(ICH_MIN)
$(ICH): $(BASE_FILES)
@@echo
@@echo "Building" $(ICH) "..."
@@cat $(BASE_FILES) | sed -e 's/@VERSION@/$(VERSION)/' > $(ICH)
@@echo $(ICH) "built."
@@echo
$(ICH_MIN): $(ICH)
@@echo
@@echo "Building" $(ICH_MIN) "..."
ifdef YUI_COMPRESSOR
@@java -jar $(YUI_COMPRESSOR) --type js $(ICH) > $(ICH_MIN)
@@echo $(ICH_MIN) "built."
else
@@echo $(ICH_MIN) "not built."
@@echo " YUI Compressor required to build minified version."
@@echo " Please set YUI_COMPRESSOR variable in 'make' file to the jar file."
endif
@@echo