forked from TriumphLLC/Blend4Web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
181 lines (134 loc) · 4.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
APIDOCDIR = deploy/api_doc
DOCSRCDIR = doc_src
APPDIR = apps_dev
APIDOCRESDIR = doc_src/api_doc/jsdoc_resources
PROJDIR = projects
SCRIPTSDIR = scripts
ASSETPACKSDIR= deploy/pub/asset_packs
PROJECTS_APPS_DEV = \
AR \
capri \
code_snippets \
dairy_plant \
dairy_plant_vr \
debugger \
farm \
fashion \
flight \
new_year \
petigors_tale \
space_disaster \
victory_day_2015 \
viewer \
webplayer \
website \
tutorials/cartoon_interior \
tutorials/firstperson \
tutorials/making_a_game_p1-3 \
tutorials/making_a_game_p4 \
tutorials/making_a_game_p5-6 \
tutorials/making_a_game_p7-12 \
tutorials/web_page_integration \
PROJECTS = \
simple_app \
ASSET_PACKS = \
pack_dairy_plant \
pack_fashion \
pack_farm \
pack_petigors_tale
DISTFILESDIR = distfiles
DISTS_SDK = dist_ce dist_pro dist_ce_lite dist_pro_lite
DISTS_SDK_FORCE = dist_force_ce dist_force_pro dist_force_ce_lite dist_force_pro_lite
# exec "VERPREFIX=_new_prefix make -e" to override
VERPREFIX=
VERSION=`sed -e 's/\./_/' -e 's/ *[^ ]\+ *//' -e 's/ \+.*/'$(VERPREFIX)'/' VERSION`
.PHONY: all
all: build
.PHONY: build
build: convert_resources compile reexport doc_clean doc
.PHONY: compile
compile: compile_shaders compile_b4w build_projects
.PHONY: compile_shaders
compile_shaders:
@echo "Compiling b4w shaders"
@`which node || which nodejs` tools/glsl/compiler/compile_shader_texts.js --obf --rem_braces
.PHONY: verify_shaders
verify_shaders:
@echo "Verifying b4w shaders"
@`which node || which nodejs` tools/glsl/compiler/compile_shader_texts.js --dry --obf --rem_braces
.PHONY: compile_b4w
compile_b4w:
@echo "Compiling b4w javascript"
@$(SH) ./scripts/compile_b4w.py -o whitespace -b -w
@$(SH) ./scripts/compile_b4w.py -o simple -b -w
@$(SH) ./scripts/compile_b4w.py -o advanced -b -w
.PHONY: build_projects $(PROJECTS_APPS_DEV) $(PROJECTS)
build_projects: $(PROJECTS_APPS_DEV) $(PROJECTS)
$(PROJECTS_APPS_DEV):
-@$(SH) ./$(APPDIR)/project.py -p $(APPDIR)/$@ build -v $(VERSION) -w
$(PROJECTS):
-@$(SH) ./$(APPDIR)/project.py -p $(PROJDIR)/$@ build -v $(VERSION) -w
.PHONY: convert_resources
convert_resources:
@echo "Converting resources"
@$(SH) ./$(SCRIPTSDIR)/converter.py resize_textures
@$(SH) ./$(SCRIPTSDIR)/converter.py convert_dds
@$(SH) ./$(SCRIPTSDIR)/converter.py convert_pvr
@$(SH) ./$(SCRIPTSDIR)/converter.py convert_media
.PHONY: doc
doc: doc_html doc_pdf api_doc
.PHONY: doc_html
doc_html:
-$(MAKE) -C $(DOCSRCDIR)
.PHONY: doc_pdf
doc_pdf:
-$(MAKE) -C $(DOCSRCDIR) latexpdf
.PHONY: doc_clean
doc_clean:
-$(MAKE) -C $(DOCSRCDIR) clean
.PHONY: api_doc
api_doc:
jsdoc --destination $(APIDOCDIR) src/b4w.js src/ext src/addons src/libs/gl-matrix2.js doc_src/api_doc/API_REF.md -c $(APIDOCRESDIR)/conf.json -t $(APIDOCRESDIR)/b4w_default
.PHONY: api_doc_pdf
api_doc_pdf:
htmldoc --webpage -f $(APIDOCDIR)/api_doc.pdf $(APIDOCDIR)/module-*
.PHONY: api_doc_clean
api_doc_clean:
-$(RM) -r $(APIDOCDIR)/*
.PHONY: reexport
reexport: reexport_json reexport_conv_html
.PHONY: reexport_json
reexport_json:
@$(SH) ./$(SCRIPTSDIR)/process_blend.py -j reexport
.PHONY: reexport_html
reexport_html:
@$(SH) ./$(SCRIPTSDIR)/process_blend.py -h reexport
.PHONY: reexport_conv_html
reexport_conv_html:
@$(SH) ./$(SCRIPTSDIR)/process_blend.py -h reexport_conv_media
.PHONY: report_broken_exports
report_broken_exports:
@$(SH) ./$(SCRIPTSDIR)/process_blend.py -jh report
.PHONY: dist dist_addon $(DISTS_SDK) dist_force dist_force_addon $(DISTS_SDK_FORCE)
dist: dist_addon $(DISTS_SDK) $(ASSET_PACKS)
dist_addon:
@echo "Creating blend4web $(subst dist_,,$@) $(VERSION) distribution"
@$(SH) ./$(SCRIPTSDIR)/make_dist.py -r blend4web -v $(VERSION) $(DISTFILESDIR)/blend4web_addon.lst
$(DISTS_SDK):
@echo "Creating blend4web $(subst dist_,,$@) $(VERSION) distribution"
@$(SH) ./$(SCRIPTSDIR)/make_dist.py -v $(VERSION) $(DISTFILESDIR)/$(subst dist,blend4web,$@).lst
$(ASSET_PACKS):
@echo "Creating $(subst pack_,,$@) asset pack"
$(SH) ./$(APPDIR)/project.py export $(APPDIR)/$(subst pack_,,$@) $(ASSETPACKSDIR)/$(subst pack_,,$@)_$(VERSION).zip
dist_force: dist_force_addon $(DISTS_SDK_FORCE) $(ASSET_PACKS)
dist_force_addon:
@echo "Creating blend4web $(subst dist_force_,,$@) $(VERSION) distribution (overwrite mode)"
@$(SH) ./$(SCRIPTSDIR)/make_dist.py -f -r blend4web -v $(VERSION) $(DISTFILESDIR)/blend4web_addon.lst
$(DISTS_SDK_FORCE):
@echo "Creating blend4web $(subst dist_force_,,$@) $(VERSION) distribution (overwrite mode)"
@$(SH) ./$(SCRIPTSDIR)/make_dist.py -f -v $(VERSION) $(DISTFILESDIR)/$(subst dist_force,blend4web,$@).lst
resave:
@$(SH) ./$(SCRIPTSDIR)/process_blend.py -jh resave
deploy_website:
@$(SH) ./$(APPDIR)/project.py -p $(APPDIR)/website deploy
# vim: set noet ts=4 sw=4: