/
Makefile
89 lines (58 loc) · 1.97 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
81
82
83
84
85
86
87
88
89
#all: checkCommands lint min minBundle debugBundle css docs
all: checkCommands min minBundle debugBundle css docs
.PHONY: docs
updateAux:
#@wget https://raw.github.com/toji/gl-matrix/master/dist/gl-matrix.js
@curl -O https://raw.github.com/toji/gl-matrix/master/dist/gl-matrix.js
@mv gl-matrix.js aux
@cat aux/gl-matrix-patch.js >> aux/gl-matrix.js
checkCommands:
ifeq ($(shell which lessc),)
$(error lessc not found! Do: sudo npm install -g less)
endif
ifeq ($(shell which jshint),)
$(error jshint not found! Do: sudo npm install -g jshint)
endif
ifeq ($(shell which uglifyjs),)
$(error uglifyjs not found! Do: sudo npm install -g uglify-js)
endif
ifeq ($(shell which yuidoc),)
$(error yuidoc not found! Do: sudo npm install -g yuidocjs)
endif
clean:
@rm -rf docs bin jsdev.c jsdev
$(CURDIR)/jsdev.c:
ifneq ($(shell which wget),)
@wget https://raw.github.com/douglascrockford/JSDev/master/jsdev.c
else
@curl -O https://raw.github.com/douglascrockford/JSDev/master/jsdev.c
endif
$(CURDIR)/jsdev: $(CURDIR)/jsdev.c
@gcc jsdev.c -o jsdev
copyToBin:
@mkdir -p bin
@cp aux/gl-matrix.js bin/gl-matrix.js
@cp aux/raf.js bin/raf.js
@cp src/div3d.js bin/div3d.js
css:
@lessc src/div3d.less > bin/div3d.css
bundle: copyToBin
@cat bin/gl-matrix.js > bin/div3d.bundle.js
@cat bin/raf.js >> bin/div3d.bundle.js
@cat bin/div3d.js >> bin/div3d.bundle.js
debug: $(CURDIR)/jsdev
@./jsdev < src/div3d.js > bin/div3d.dbg.js dbg log:console.log
debugBundle: debug
@cat bin/gl-matrix.js > bin/div3d.bundle.dbg.js
@cat bin/raf.js >> bin/div3d.bundle.dbg.js
@cat bin/div3d.dbg.js >> bin/div3d.bundle.dbg.js
min: copyToBin
@uglifyjs bin/gl-matrix.js > bin/gl-matrix.min.js
@uglifyjs bin/raf.js > bin/raf.min.js
@uglifyjs bin/div3d.js > bin/div3d.min.js
minBundle: bundle
@uglifyjs bin/div3d.bundle.js > bin/div3d.bundle.min.js
lint: src/div3d.js
@jshint src/div3d.js samples/*.js
docs:
@yuidoc -c .yuidoc.json --no-code -T default -q ./src