Skip to content
Newer
Older
100644 132 lines (97 sloc) 5.2 KB
a75a91a @corbanbrook #470 Move out of Makefile (humphd)
corbanbrook authored
1 # Make sure $JSSHELL points to your js shell binary in .profile or .bashrc
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
2 TOOLSDIR=./tools
3
4 # Rule for making pure JS code from a .pde (runs through parser + beautify)
5 %.js : %.pde
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
6 ${TOOLSDIR}/pde2js.py ${JSSHELL} $?
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
7
8 all: release
9
10 create-release: clean
11 mkdir ./release
12
24a7561 @corbanbrook #314 Improve make release. (humphd)
corbanbrook authored
13 # Version number used in naming release files.
14 VERSION ?= $(error Specify a version for your release (e.g., VERSION=0.5))
15
16 release: release-files zipped
17
9665b63 @notmasteryet Merge branch '0.9.7' of http://github.com/annasob/processing-js.git i…
notmasteryet authored
18 release-files: pjs yui closure example release-docs
24a7561 @corbanbrook #314 Improve make release. (humphd)
corbanbrook authored
19
20 zipped: release-files
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
21 gzip -c ./release/processing-${VERSION}.min.js > ./release/processing-${VERSION}.min.js.gz
22 find ./release -print | zip -j ./release/processing.js-${VERSION}.zip -@
24a7561 @corbanbrook #314 Improve make release. (humphd)
corbanbrook authored
23
24 release-docs: create-release
6cdc099 @corbanbrook #332 Add AUTHORS to Makefile for release target.
corbanbrook authored
25 cp AUTHORS ./release
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
26 cat README | sed -e 's/@VERSION@/${VERSION}/' > ./release/README
7cd4e8c @corbanbrook Updated make release to include LICENSE and CHANGELOG.
corbanbrook authored
27 cp LICENSE ./release
28 cp CHANGELOG ./release
24a7561 @corbanbrook #314 Improve make release. (humphd)
corbanbrook authored
29
a08fc4e @corbanbrook #568 Remove jsbeautify from release target (humphd)
corbanbrook authored
30 example: create-release pjs
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
31 echo "<script src=\"processing-${VERSION}.js\"></script>" > ./release/example.html
24a7561 @corbanbrook #314 Improve make release. (humphd)
corbanbrook authored
32 echo "<canvas datasrc=\"example.pjs\" width=\"200\" height=\"200\"></canvas>" >> ./release/example.html
33 cp example.pjs ./release
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
34
35 pretty: create-release
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
36 ${TOOLSDIR}/jsbeautify.py ${JSSHELL} processing.js > ./release/processing-${VERSION}.js.tmp
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
37 # check for any parsing errors in pretty version of processing.js
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
38 ${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ./release/processing-${VERSION}.js.tmp
39 cat ./release/processing-${VERSION}.js.tmp | sed -e 's/@VERSION@/${VERSION}/' > ./release/processing-${VERSION}.js
40 rm -f ./release/processing-${VERSION}.js.tmp
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
41
a08fc4e @corbanbrook #568 Remove jsbeautify from release target (humphd)
corbanbrook authored
42 pjs: create-release
43 cp processing.js ./release/processing-${VERSION}.js.tmp
44 # check for any parsing errors in processing.js
45 ${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ./release/processing-${VERSION}.js.tmp
46 cat ./release/processing-${VERSION}.js.tmp | sed -e 's/@VERSION@/${VERSION}/' > ./release/processing-${VERSION}.js
47 rm -f ./release/processing-${VERSION}.js.tmp
48
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
49 packed: create-release
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
50 ${TOOLSDIR}/packer.py ${JSSHELL} processing.js > ./release/processing-${VERSION}.packed.js
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
51 # check for any parsing errors in packed version of processing.js
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
52 ${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ./release/processing-${VERSION}.packed.js
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
53
54 minified: create-release
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
55 ${TOOLSDIR}/minifier.py ${JSSHELL} processing.js > ./release/processing-${VERSION}.jsmin.js
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
56 # check for any parsing errors in minified version of processing.js
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
57 ${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ./release/processing-${VERSION}.jsmin.js
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
58
50add05 @corbanbrook #464 Move to YUI Compressor, add make check-release (humphd)
corbanbrook authored
59 yui: create-release
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
60 java -jar ${TOOLSDIR}/yui/yuicompressor-2.4.2.jar --nomunge processing.js -o ./release/processing-${VERSION}.min.js
76b770c @corbanbrook #229 Google Closure added.
corbanbrook authored
61 # check for any parsing errors in compiled version of processing.js
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
62 ${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ./release/processing-${VERSION}.min.js
76b770c @corbanbrook #229 Google Closure added.
corbanbrook authored
63
1580676 @notmasteryet Check and update for globals
notmasteryet authored
64 check: check-globals
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
65 ${TOOLSDIR}/runtests.py ${JSSHELL}
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
66
50add05 @corbanbrook #464 Move to YUI Compressor, add make check-release (humphd)
corbanbrook authored
67 check-release: yui
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
68 ${TOOLSDIR}/runtests.py ${JSSHELL} -l ./release/processing-${VERSION}.min.js
50add05 @corbanbrook #464 Move to YUI Compressor, add make check-release (humphd)
corbanbrook authored
69
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
70 check-summary:
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
71 ${TOOLSDIR}/runtests.py -s ${JSSHELL}
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
72
73 check-lint:
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
74 ${TOOLSDIR}/jslint.py ${JSSHELL} processing.js
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
75
76 check-parser:
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
77 ${TOOLSDIR}/runtests.py -p ${JSSHELL}
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
78
79 check-unit:
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
80 ${TOOLSDIR}/runtests.py -u ${JSSHELL}
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
81
9665b63 @notmasteryet Merge branch '0.9.7' of http://github.com/annasob/processing-js.git i…
notmasteryet authored
82 CLOSUREJAR ?= $(error Specify a valid path to a Google closure jar file in ~/.profile: export CLOSUREJAR=~/compiler.jar)
2006ad4 @notmasteryet PJS compression, compilation and preprocessor
notmasteryet authored
83
84 SKETCHRUN ?= runSketch
80b0422 @notmasteryet fixing regular make check
notmasteryet authored
85 SKETCHINPUT ?= $(error Specify an input filename in SKETCHINPUT when using package-sketch)
2006ad4 @notmasteryet PJS compression, compilation and preprocessor
notmasteryet authored
86 SKETCHOUTPUT ?= ${SKETCHINPUT}.js
87
9665b63 @notmasteryet Merge branch '0.9.7' of http://github.com/annasob/processing-js.git i…
notmasteryet authored
88 closure: create-release
89 java -jar ${CLOSUREJAR} --js=processing.js --js_output_file=./release/processing-${VERSION}.closure.js
90
91 check-closure: closure
6a73393 @notmasteryet compiler and make check-closure
notmasteryet authored
92 java -jar ${CLOSUREJAR} --js=processing.js --js_output_file=./release/processing-closure.js
93 ${TOOLSDIR}/runtests.py ${JSSHELL} -l ./release/processing-closure.js
94
2006ad4 @notmasteryet PJS compression, compilation and preprocessor
notmasteryet authored
95 compile-sketch:
96 ${JSSHELL} -f processing.js -f ${TOOLSDIR}/jscompile.js < ${SKETCHINPUT} > ${SKETCHOUTPUT}
9665b63 @notmasteryet Merge branch '0.9.7' of http://github.com/annasob/processing-js.git i…
notmasteryet authored
97 echo "Created ${SKETCHOUTPUT}"
2006ad4 @notmasteryet PJS compression, compilation and preprocessor
notmasteryet authored
98
99 package-sketch:
100 echo "function ${SKETCHRUN}(canvas) {" > ${SKETCHOUTPUT}.src
101 ${JSSHELL} -f ${TOOLSDIR}/jspreprocess.js -e "PARSER=false;preprocess();" < processing.js >> ${SKETCHOUTPUT}.src
102 echo "return new Processing(canvas," >> ${SKETCHOUTPUT}.src
103 ${JSSHELL} -f processing.js -f ${TOOLSDIR}/jscompile.js < ${SKETCHINPUT} >> ${SKETCHOUTPUT}.src
104 echo "); } window['${SKETCHRUN}']=${SKETCHRUN};" >> ${SKETCHOUTPUT}.src
105 java -jar ${CLOSUREJAR} --js=${SKETCHOUTPUT}.src --js_output_file=${SKETCHOUTPUT} --compilation_level ADVANCED_OPTIMIZATIONS
106 rm ${SKETCHOUTPUT}.src
9665b63 @notmasteryet Merge branch '0.9.7' of http://github.com/annasob/processing-js.git i…
notmasteryet authored
107 echo "Created ${SKETCHOUTPUT}"
2006ad4 @notmasteryet PJS compression, compilation and preprocessor
notmasteryet authored
108
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
109 # If you want to test just one file or dir, use |make check-one TEST=<file or dir>|
110 TEST ?= $(error Specify a test filename/dir in TEST when using check-test)
111
43f8d00 @corbanbrook #529 make check-lint env var bug. (humphd)
corbanbrook authored
112 # Most targets use commands that need a js shell path specified
113 JSSHELL ?= $(error Specify a valid path to a js shell binary in ~/.profile: export JSSHELL=C:\path\js.exe or /path/js)
114
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
115 check-one:
f1942d6 @corbanbrook #491 Automatically write version numbers in README/processing.js for …
corbanbrook authored
116 ${TOOLSDIR}/runtests.py ${JSSHELL} -t ${TEST}
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
117
f841c0f @notmasteryet add-coverage depend on create-release
notmasteryet authored
118 add-coverage: create-release
40a0f99 @notmasteryet Coverage testing
notmasteryet authored
119 cat processing.js | ${JSSHELL} -f ${TOOLSDIR}/jscoverage.js > ./release/processing-cv.js
120
121 check-coverage: add-coverage
122 ${TOOLSDIR}/runtests.py ${JSSHELL} -l ./release/processing-cv.js -c ./release/codecoverage.txt
123
1580676 @notmasteryet Check and update for globals
notmasteryet authored
124 check-globals:
125 ${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ${TOOLSDIR}/jsglobals.js -e "findDifference()" < processing.js
126
21d7859 #730 added check and print globals to generate global names array
notmasteryet authored
127 print-globals:
128 ${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ${TOOLSDIR}/jsglobals.js -e "printNames()" < processing.js
129
cb80c0d @corbanbrook #228 Staged the automated test suite.
corbanbrook authored
130 clean:
131 rm -fr ./release
Something went wrong with that request. Please try again.