forked from akdubya/dustjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (65 loc) · 1.3 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
74
75
76
77
78
#
# Run all tests
#
test:
node test/server.js
#
# Run the benchmarks
#
bench:
node benchmark/server.js
#
# Build the docs
#
docs:
node docs/build.js
#
# Build the parser
#
parser:
node src/build.js
#
# Build dust.js
#
SRC = lib
VERSION = ${shell cat package.json | grep version | grep -o '[0-9]\.[0-9]\.[0-9]\+'}
CORE = dist/dust-core-${VERSION}.js
CORE_MIN = dist/dust-core-${VERSION}.min.js
FULL = dist/dust-full-${VERSION}.js
FULL_MIN = dist/dust-full-${VERSION}.min.js
define HEADER
//
// Dust - Asynchronous Templating v${VERSION}
// http://akdubya.github.com/dustjs
//
// Copyright (c) 2010, Aleksander Williams
// Released under the MIT License.
//
endef
export HEADER
dust:
@@mkdir -p dist
@@touch ${CORE}
@@echo "$$HEADER" > ${CORE}
@@cat ${SRC}/dust.js >> ${CORE}
@@echo ${CORE} built
@@touch ${FULL}
@@echo "$$HEADER" > ${FULL}
@@cat ${SRC}/dust.js\
${SRC}/compiler.js\
${SRC}/parser.js >> ${FULL}
@@echo ${FULL} built
min: dust
@@echo minifying...
@@echo "$$HEADER" > ${CORE_MIN}
@@echo "$$HEADER" > ${FULL_MIN}
@@minmin ${CORE} >> ${CORE_MIN}
@@minmin ${FULL} >> ${FULL_MIN}
clean:
git rm dist/*
release: clean docs min
git add dist/*
git commit -a -m "release v${VERSION}"
git tag -a -m "version v${VERSION}" v${VERSION}
npm publish
.PHONY: test docs bench parser