forked from processing-js/processing-js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
80 lines (58 loc) · 2.65 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
79
80
# Make sure $JSSHELL points to your js shell binary in .profile or .bashrc
TOOLSDIR=./tools
# Rule for making pure JS code from a .pde (runs through parser + beautify)
%.js : %.pde
$(TOOLSDIR)/pde2js.py $(JSSHELL) $?
all: release
create-release: clean
mkdir ./release
# Version number used in naming release files.
VERSION ?= $(error Specify a version for your release (e.g., VERSION=0.5))
release: release-files zipped
release-files: pretty yui example release-docs
zipped: release-files
gzip -c ./release/processing-$(VERSION).min.js > ./release/processing-$(VERSION).min.js.gz
find ./release -print | zip -j ./release/processing.js-$(VERSION).zip -@
release-docs: create-release
cp AUTHORS ./release
cp README ./release
cp LICENSE ./release
cp CHANGELOG ./release
example: create-release pretty
echo "<script src=\"processing-$(VERSION).js\"></script>" > ./release/example.html
echo "<canvas datasrc=\"example.pjs\" width=\"200\" height=\"200\"></canvas>" >> ./release/example.html
cp example.pjs ./release
pretty: create-release
$(TOOLSDIR)/jsbeautify.py $(JSSHELL) processing.js > ./release/processing-$(VERSION).js
# check for any parsing errors in pretty version of processing.js
$(JSSHELL) -f $(TOOLSDIR)/fake-dom.js -f ./release/processing-$(VERSION).js
packed: create-release
$(TOOLSDIR)/packer.py $(JSSHELL) processing.js > ./release/processing-$(VERSION).packed.js
# check for any parsing errors in packed version of processing.js
$(JSSHELL) -f $(TOOLSDIR)/fake-dom.js -f ./release/processing-$(VERSION).packed.js
minified: create-release
$(TOOLSDIR)/minifier.py $(JSSHELL) processing.js > ./release/processing-$(VERSION).jsmin.js
# check for any parsing errors in minified version of processing.js
$(JSSHELL) -f $(TOOLSDIR)/fake-dom.js -f ./release/processing-$(VERSION).jsmin.js
yui: create-release
java -jar $(TOOLSDIR)/yui/yuicompressor-2.4.2.jar --nomunge processing.js -o ./release/processing-$(VERSION).min.js
# check for any parsing errors in compiled version of processing.js
$(JSSHELL) -f $(TOOLSDIR)/fake-dom.js -f ./release/processing-$(VERSION).min.js
check:
$(TOOLSDIR)/runtests.py $(JSSHELL)
check-release: yui
$(TOOLSDIR)/runtests.py $(JSSHELL) -l ./release/processing-$(VERSION).min.js
check-summary:
$(TOOLSDIR)/runtests.py -s $(JSSHELL)
check-lint:
$(TOOLSDIR)/jslint.py $(JSSHELL) processing.js
check-parser:
$(TOOLSDIR)/runtests.py -p $(JSSHELL)
check-unit:
$(TOOLSDIR)/runtests.py -u $(JSSHELL)
# If you want to test just one file or dir, use |make check-one TEST=<file or dir>|
TEST ?= $(error Specify a test filename/dir in TEST when using check-test)
check-one:
$(TOOLSDIR)/runtests.py $(JSSHELL) -t $(TEST)
clean:
rm -fr ./release