-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
73 lines (59 loc) · 2.02 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
# Run all tests
#
test:
node test/cake-test.js
#
# Run benchmark
#
benchmark:
node benchmark/cake-benchmark.js
#
# Build CakeJs.js
#
SRC = lib
HEADER = build/header.js
#VERSION = `cat package.json | grep version | grep -o '[0-9]\.[0-9]\.[0-9]\+'` #$(shell node build/package_parser.js package.json version)
VERSION =`cat package.json | grep version \
| grep -o '[0-9]\.[0-9]\.[0-9]\+'`
#DESCRIPTION = $(shell node build/package_parser.js package.json description) #`cat package.json | grep description`
#URL = $(shell node build/package_parser.js package.json url)
#COPYRIGHT = $(shell node build/package_parser.js package.json copyright)
#LICENSE = $(shell node build/package_parser.js package.json license)
DIST = dist/cake-${VERSION}.js
DIST_MIN = dist/cake-${VERSION}.min.js
cake:
@@mkdir -p dist
@@touch ${DIST}
@@cat ${HEADER} | sed s/@VERSION/${VERSION}/ > ${DIST}
# @@cat ${DIST} | sed s/@DESCRIPTION/${DESCRIPTION}/ > ${DIST}
# @@cat ${DIST} | sed s/@URL/$(URL)/ > ${DIST}
# @@cat ${DIST} | sed s/@LICENSE/$(LICENSE)/ > ${DIST}
# @@cat ${DIST} | sed s/@COPYRIGHT/$(COPYRIGHT)/ > ${DIST}
@@echo "(function (window, undefined) {" >> ${DIST}
@@cat ${SRC}/main.js \
${SRC}/Utils/*.js \
${SRC}/Cake/Base/*.js \
${SRC}/Cake/Components/CanvasNode.js \
${SRC}/Cake/Components/ElementNode.js \
${SRC}/Cake/Components/Canvas.js \
${SRC}/Cake/Components/Drawable.js \
${SRC}/Cake/Components/Drawables/*.js \
${SRC}/last.js >> ${DIST}
@@echo "})(window);" >> ${DIST}
@@echo ${DIST} built.
min: cake
@@echo minifying...
@@cat ${HEADER} | sed s/@VERSION/${VERSION}/ > ${DIST_MIN}
@@java -jar build/compiler.jar\
--js ${DIST} >> ${DIST_MIN}
clean:
git rm dist/*
dist: clean min
git add dist/*
git commit -a -m "(dist) build ${VERSION}"
git archive master --prefix=cake/ -o cake-${VERSION}.tar.gz
npm publish cake-${VERSION}.tar.gz
stable:
npm tag cake ${VERSION} stable
.PHONY: test benchmark