~george-edison55/less/trunk

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Nathan Osman
  • Date: 2013-04-16 22:43:51 UTC
  • Revision ID: admin@quickmediasolutions.com-20130416224351-5juqujuu4itkwpat
Initial commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Run all tests
 
3
#
 
4
test: 
 
5
        node test/less-test.js
 
6
 
 
7
#
 
8
# Run benchmark
 
9
#
 
10
benchmark:
 
11
        node benchmark/less-benchmark.js
 
12
 
 
13
#
 
14
# Build less.js
 
15
#
 
16
SRC = lib/less
 
17
HEADER = build/header.js
 
18
VERSION = `cat package.json | grep version \
 
19
                                                                                                                | grep -o '[0-9]\.[0-9]\.[0-9]\+'`
 
20
DIST = dist/less-${VERSION}.js
 
21
RHINO = dist/less-rhino-${VERSION}.js
 
22
DIST_MIN = dist/less-${VERSION}.min.js
 
23
 
 
24
browser-prepare: DIST := test/browser/less.js
 
25
 
 
26
alpha: DIST := dist/less-${VERSION}-alpha.js
 
27
alpha: DIST_MIN := dist/less-${VERSION}-alpha.min.js
 
28
 
 
29
beta: DIST := dist/less-${VERSION}-beta.js
 
30
beta: DIST_MIN := dist/less-${VERSION}-beta.min.js
 
31
 
 
32
less:
 
33
        @@mkdir -p dist
 
34
        @@touch ${DIST}
 
35
        @@cat ${HEADER} | sed s/@VERSION/${VERSION}/ > ${DIST}
 
36
        @@echo "(function (window, undefined) {" >> ${DIST}
 
37
        @@cat build/require.js\
 
38
              build/ecma-5.js\
 
39
              ${SRC}/parser.js\
 
40
              ${SRC}/functions.js\
 
41
              ${SRC}/colors.js\
 
42
              ${SRC}/tree/*.js\
 
43
              ${SRC}/tree.js\
 
44
              ${SRC}/env.js\
 
45
              ${SRC}/visitor.js\
 
46
              ${SRC}/import-visitor.js\
 
47
              ${SRC}/join-selector-visitor.js\
 
48
              ${SRC}/extend-visitor.js\
 
49
              ${SRC}/browser.js\
 
50
              build/amd.js >> ${DIST}
 
51
        @@echo "})(window);" >> ${DIST}
 
52
        @@echo ${DIST} built.
 
53
        
 
54
browser-prepare: less
 
55
        node test/browser-test-prepare.js
 
56
        
 
57
browser-test: browser-prepare
 
58
        phantomjs test/browser/phantom-runner.js
 
59
 
 
60
browser-test-server: browser-prepare
 
61
        phantomjs test/browser/phantom-runner.js --no-tests
 
62
 
 
63
rhino:
 
64
        @@mkdir -p dist
 
65
        @@touch ${RHINO}
 
66
        @@cat build/require-rhino.js\
 
67
              build/ecma-5.js\
 
68
              ${SRC}/parser.js\
 
69
              ${SRC}/env.js\
 
70
              ${SRC}/visitor.js\
 
71
              ${SRC}/import-visitor.js\
 
72
              ${SRC}/join-selector-visitor.js\
 
73
              ${SRC}/extend-visitor.js\
 
74
              ${SRC}/functions.js\
 
75
              ${SRC}/colors.js\
 
76
              ${SRC}/tree/*.js\
 
77
              ${SRC}/tree.js\
 
78
              ${SRC}/rhino.js > ${RHINO}
 
79
        @@echo ${RHINO} built.
 
80
 
 
81
min: less
 
82
        @@echo minifying...
 
83
        @@uglifyjs ${DIST} > ${DIST_MIN}
 
84
        @@echo ${DIST_MIN} built.
 
85
 
 
86
alpha: min
 
87
 
 
88
beta: min
 
89
 
 
90
alpha-release: alpha
 
91
        git add dist/*.js
 
92
        git commit -m "Update alpha ${VERSION}"
 
93
 
 
94
dist: min rhino
 
95
        git add dist/*
 
96
        git commit -a -m "(dist) build ${VERSION}"
 
97
        git archive master --prefix=less/ -o less-${VERSION}.tar.gz
 
98
        npm publish less-${VERSION}.tar.gz
 
99
 
 
100
stable:
 
101
        npm tag less@${VERSION} stable
 
102
 
 
103
 
 
104
.PHONY: test benchmark