forked from epfl-mobots/vpl-teacher-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
317 lines (287 loc) · 10.9 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# Author: Yves Piguet, EPFL
# Please don't redistribute without author's permission.
# build distribution
DIR = vpl-teacher-distrib
ROOTFILES = \
Makefile \
launch_objc.py \
launch_tk.py \
launch_windows.bat \
launch_mac.command \
launch_wx.py \
setup.py \
setup_app.py
VPL3PKGFILES = \
vpl3tt/__init__.py \
vpl3tt/baseapp.py \
vpl3tt/cacaoapp.py \
vpl3tt/com_http.py \
vpl3tt/com_ws.py \
vpl3tt/db.py \
vpl3tt/launch.py \
vpl3tt/server.py \
vpl3tt/server_http.py \
vpl3tt/server_thymio.py \
vpl3tt/server_ws.py \
vpl3tt/tdm_client.py \
vpl3tt/tkapp.py \
vpl3tt/objcapp.py \
vpl3tt/translate.py \
vpl3tt/translate_fr.py \
vpl3tt/urltiny.py \
vpl3tt/urlutil.py \
vpl3tt/wxapp.py
DOCFILES = \
vpl3tt/doc/client.js \
vpl3tt/doc/db.html \
vpl3tt/doc/index.html \
vpl3tt/doc/login.en.html \
vpl3tt/doc/login.fr.html \
vpl3tt/doc/login.it.html \
vpl3tt/doc/login-gui.js \
vpl3tt/doc/tr-mappings.json \
vpl3tt/doc/tt.html \
vpl3tt/doc/tt.fr.html
VPLFILES = \
vpl3tt/doc/vpl/EPFL_Logo_SVG.svg \
vpl3tt/doc/vpl/grs_logo_RGB.svg \
vpl3tt/doc/vpl/Logo_vpl.svg \
vpl3tt/doc/vpl/vpl-about.html \
vpl3tt/doc/vpl/vpl.html \
vpl3tt/doc/vpl/vpl-min.js
THYMIOFILES = \
vpl3tt/doc/vpl/thymio/thymio.js
UIFILES = \
vpl3tt/doc/vpl/ui/toc.json
UICLASSICFILES = \
vpl3tt/doc/vpl/ui/classic/aesl.json \
vpl3tt/doc/vpl/ui/classic/aseba.json \
vpl3tt/doc/vpl/ui/classic/block-en.json \
vpl3tt/doc/vpl/ui/classic/block-fr.json \
vpl3tt/doc/vpl/ui/classic/block-list.json \
vpl3tt/doc/vpl/ui/classic/classic.css \
vpl3tt/doc/vpl/ui/classic/cmd-sim-en.json \
vpl3tt/doc/vpl/ui/classic/cmd-sim-fr.json \
vpl3tt/doc/vpl/ui/classic/cmd-vpl-en.json \
vpl3tt/doc/vpl/ui/classic/cmd-vpl-fr.json \
vpl3tt/doc/vpl/ui/classic/doctemplate-en.html \
vpl3tt/doc/vpl/ui/classic/doctemplate-fr.html \
vpl3tt/doc/vpl/ui/classic/messages-fr.json \
vpl3tt/doc/vpl/ui/classic/help-blocks-en.json \
vpl3tt/doc/vpl/ui/classic/help-blocks-fr.json \
vpl3tt/doc/vpl/ui/classic/help-buttons-en.json \
vpl3tt/doc/vpl/ui/classic/help-buttons-fr.json \
vpl3tt/doc/vpl/ui/classic/js.json \
vpl3tt/doc/vpl/ui/classic/l2.json \
vpl3tt/doc/vpl/ui/classic/python.json \
vpl3tt/doc/vpl/ui/classic/typical-param-set.json \
vpl3tt/doc/vpl/ui/classic/typical-states.json \
vpl3tt/doc/vpl/ui/classic/ui.json
UISVGFILES = \
vpl3tt/doc/vpl/ui/svg/aesl.json \
vpl3tt/doc/vpl/ui/svg/aseba.json \
vpl3tt/doc/vpl/ui/svg/block-en.json \
vpl3tt/doc/vpl/ui/svg/block-de.json \
vpl3tt/doc/vpl/ui/svg/block-fr.json \
vpl3tt/doc/vpl/ui/svg/block-it.json \
vpl3tt/doc/vpl/ui/svg/block-list.json \
vpl3tt/doc/vpl/ui/svg/Blocks.svg \
vpl3tt/doc/vpl/ui/svg/Blocks16.svg \
vpl3tt/doc/vpl/ui/svg/buttons.json \
vpl3tt/doc/vpl/ui/svg/cmd-sim-en.json \
vpl3tt/doc/vpl/ui/svg/cmd-sim-de.json \
vpl3tt/doc/vpl/ui/svg/cmd-sim-fr.json \
vpl3tt/doc/vpl/ui/svg/cmd-sim-it.json \
vpl3tt/doc/vpl/ui/svg/cmd-vpl-en.json \
vpl3tt/doc/vpl/ui/svg/cmd-vpl-de.json \
vpl3tt/doc/vpl/ui/svg/cmd-vpl-fr.json \
vpl3tt/doc/vpl/ui/svg/cmd-vpl-it.json \
vpl3tt/doc/vpl/ui/svg/doctemplate-en.html \
vpl3tt/doc/vpl/ui/svg/doctemplate-de.html \
vpl3tt/doc/vpl/ui/svg/doctemplate-fr.html \
vpl3tt/doc/vpl/ui/svg/doctemplate-it.html \
vpl3tt/doc/vpl/ui/svg/messages-en.json \
vpl3tt/doc/vpl/ui/svg/messages-de.json \
vpl3tt/doc/vpl/ui/svg/messages-fr.json \
vpl3tt/doc/vpl/ui/svg/messages-it.json \
vpl3tt/doc/vpl/ui/svg/help-blocks-en.json \
vpl3tt/doc/vpl/ui/svg/help-blocks-de.json \
vpl3tt/doc/vpl/ui/svg/help-blocks-fr.json \
vpl3tt/doc/vpl/ui/svg/help-blocks-it.json \
vpl3tt/doc/vpl/ui/svg/Icons.svg \
vpl3tt/doc/vpl/ui/svg/js.json \
vpl3tt/doc/vpl/ui/svg/l2.json \
vpl3tt/doc/vpl/ui/svg/python.json \
vpl3tt/doc/vpl/ui/svg/svg.css \
vpl3tt/doc/vpl/ui/svg/toolbars.json \
vpl3tt/doc/vpl/ui/svg/ui.json
TOOLSFILES = \
vpl3tt/doc/vpl-teacher-tools/dashboard-gui.js \
vpl3tt/doc/vpl-teacher-tools/dashboard.html \
vpl3tt/doc/vpl-teacher-tools/dashboard.fr.html \
vpl3tt/doc/vpl-teacher-tools/dashboard.js \
vpl3tt/doc/vpl-teacher-tools/dev.html \
vpl3tt/doc/vpl-teacher-tools/dev.fr.html \
vpl3tt/doc/vpl-teacher-tools/doc.html \
vpl3tt/doc/vpl-teacher-tools/doc.fr.html \
vpl3tt/doc/vpl-teacher-tools/editor-gui.js \
vpl3tt/doc/vpl-teacher-tools/editor.html \
vpl3tt/doc/vpl-teacher-tools/editor.fr.html \
vpl3tt/doc/vpl-teacher-tools/filebrowser-gui.js \
vpl3tt/doc/vpl-teacher-tools/filebrowser.html \
vpl3tt/doc/vpl-teacher-tools/filebrowser.fr.html \
vpl3tt/doc/vpl-teacher-tools/filebrowser.js \
vpl3tt/doc/vpl-teacher-tools/filedialog.js \
vpl3tt/doc/vpl-teacher-tools/html-tools.css \
vpl3tt/doc/vpl-teacher-tools/icon-file-txt.svg \
vpl3tt/doc/vpl-teacher-tools/icon-file-html.svg \
vpl3tt/doc/vpl-teacher-tools/icon-file-img.svg \
vpl3tt/doc/vpl-teacher-tools/icon-file-program.svg \
vpl3tt/doc/vpl-teacher-tools/icon-file-vpl3.svg \
vpl3tt/doc/vpl-teacher-tools/icon-file-vpl3ui.svg \
vpl3tt/doc/vpl-teacher-tools/initdb-dev-gui.js \
vpl3tt/doc/vpl-teacher-tools/initdb-dev.html \
vpl3tt/doc/vpl-teacher-tools/initdb-dev.fr.html \
vpl3tt/doc/vpl-teacher-tools/json-ws-bridge-api.js \
vpl3tt/doc/vpl-teacher-tools/login.js \
vpl3tt/doc/vpl-teacher-tools/Logo_vpl.svg \
vpl3tt/doc/vpl-teacher-tools/ns.js \
vpl3tt/doc/vpl-teacher-tools/pairing-gui.js \
vpl3tt/doc/vpl-teacher-tools/pairing.html \
vpl3tt/doc/vpl-teacher-tools/pairing.fr.html \
vpl3tt/doc/vpl-teacher-tools/robots.js \
vpl3tt/doc/vpl-teacher-tools/pairing.js \
vpl3tt/doc/vpl-teacher-tools/README.md \
vpl3tt/doc/vpl-teacher-tools/students.html \
vpl3tt/doc/vpl-teacher-tools/students-gui.js \
vpl3tt/doc/vpl-teacher-tools/students.js \
vpl3tt/doc/vpl-teacher-tools/students.fr.html \
vpl3tt/doc/vpl-teacher-tools/student-debug.html \
vpl3tt/doc/vpl-teacher-tools/student-debug.js \
vpl3tt/doc/vpl-teacher-tools/translate.js \
vpl3tt/doc/vpl-teacher-tools/ui.json \
vpl3tt/doc/vpl-teacher-tools/util-files.js \
vpl3tt/doc/vpl-teacher-tools/util-url.js \
vpl3tt/doc/vpl-teacher-tools/viewer-gui.js \
vpl3tt/doc/vpl-teacher-tools/viewer.html \
vpl3tt/doc/vpl-teacher-tools/viewer.fr.html \
vpl3tt/doc/vpl-teacher-tools/vpl-about.html \
vpl3tt/doc/vpl-teacher-tools/vpl-gui.js \
vpl3tt/doc/vpl-teacher-tools/vpl.html \
vpl3tt/doc/vpl-teacher-tools/vpl.fr.html \
vpl3tt/doc/vpl-teacher-tools/vplurl.js \
vpl3tt/doc/vpl-teacher-tools/vpl_load.png \
vpl3tt/doc/vpl-teacher-tools/vpl_new.png \
vpl3tt/doc/vpl-teacher-tools/vpl_run.png \
vpl3tt/doc/vpl-teacher-tools/vpl_stop.png
QRFILES = \
vpl3tt/doc/libs/qrcodejs/LICENSE \
vpl3tt/doc/libs/qrcodejs/README.md \
vpl3tt/doc/libs/qrcodejs/qrcode.min.js
BEHAVIORFILES = \
vpl3tt/data/behaviors/amicalV3.aseba \
vpl3tt/data/behaviors/attentifV3.aseba \
vpl3tt/data/behaviors/explorateurV7.aseba \
vpl3tt/data/behaviors/obeissantV6.aseba \
vpl3tt/data/behaviors/peureuxV3.aseba \
vpl3tt/data/behaviors/suiveurV3.aseba \
vpl3tt/data/behaviors/LICENSE.txt
DATAFILES = \
vpl3tt/data/ui/basic-sensors.vpl3ui \
vpl3tt/data/ui/basic-touch.vpl3ui \
vpl3tt/data/ui/basic-track.vpl3ui \
vpl3tt/data/ui/simple-sensors.vpl3ui \
vpl3tt/data/ui/simple-touch.vpl3ui \
vpl3tt/data/ui/simple-track.vpl3ui
UNAME = $(shell uname)
ALL = $(DIR).zip whl
ifeq ($(UNAME), Darwin)
ALL += VPLServer.dmg
endif
.PHONY: all
all: $(ALL)
$(DIR).zip:
rm -Rf $(DIR)
mkdir -p $(DIR)/vpl3tt
mkdir -p $(DIR)/vpl3tt/doc/vpl/thymio
mkdir -p $(DIR)/vpl3tt/doc/vpl/ui/classic
mkdir -p $(DIR)/vpl3tt/doc/vpl/ui/svg
mkdir -p $(DIR)/vpl3tt/doc/vpl-teacher-tools
mkdir -p $(DIR)/vpl3tt/doc/libs/qrcodejs
mkdir -p $(DIR)/vpl3tt/data
mkdir -p $(DIR)/vpl3tt/data/behaviors
cp -p $(ROOTFILES) $(DIR)
cp -p $(VPL3PKGFILES) $(DIR)/vpl3tt
cp -p $(DOCFILES) $(DIR)/vpl3tt/doc
cp -p $(VPLFILES) $(DIR)/vpl3tt/doc/vpl
cp -p $(THYMIOFILES) $(DIR)/vpl3tt/doc/vpl/thymio
cp -p $(UIFILES) $(DIR)/vpl3tt/doc/vpl/ui
cp -p $(UICLASSICFILES) $(DIR)/vpl3tt/doc/vpl/ui/classic
cp -p $(UISVGFILES) $(DIR)/vpl3tt/doc/vpl/ui/svg
cp -p $(TOOLSFILES) $(DIR)/vpl3tt/doc/vpl-teacher-tools
cp -p $(QRFILES) $(DIR)/vpl3tt/doc/libs/qrcodejs
cp -p $(DATAFILES) $(DIR)/vpl3tt/data
cp -p $(BEHAVIORFILES) $(DIR)/vpl3tt/data/behaviors
zip -r - $(DIR) >$(DIR).zip
.PHONY: whl
whl: setup.py $(VPL3PKGFILES) $(DOCFILES) $(VPLFILES) $(THYMIOFILES) $(UIFILES) $(UICLASSICFILES) $(UISVGFILES) $(TOOLSFILES) $(QRFILES) $(DATAFILES) $(BEHAVIORFILES)
rm -Rf build
python3 setup.py bdist_wheel sdist bdist_pex
.PHONY: VPL3Server.app
VPL3Server.app: setup_app.py launch_objc.py $(VPL3PKGFILES) $(DOCFILES) $(VPLFILES) $(THYMIOFILES) $(UIFILES) $(UICLASSICFILES) $(UISVGFILES) $(TOOLSFILES) $(QRFILES) $(DATAFILES) $(BEHAVIORFILES)
rm -Rf build
python3 setup_app.py py2app
./signbundle.sh VPL3Server.app "$(APPLE_CERTIFICATE_SIGNING_IDENTITY)"
.PHONY: build/VPL3Server-cxf.app
build/VPL3Server-cxf.app: setup_cx_freeze.py launch_objc.py $(VPL3PKGFILES) $(DOCFILES) $(VPLFILES) $(THYMIOFILES) $(UIFILES) $(UICLASSICFILES) $(UISVGFILES) $(TOOLSFILES) $(QRFILES) $(DATAFILES) $(BEHAVIORFILES)
rm -Rf build
python3 setup_cx_freeze.py bdist_mac
VPLServer.dmg: VPL3Server.app readme-mac.txt
rm -Rf "VPLServer" $@
mkdir "VPLServer"
cp -R $^ "VPLServer"
#hdiutil create -format UDZO -imagekey zlib-level=9 -srcfolder "VPLServer" $@
create-dmg \
--volname "VPL Server" \
--background "background.png" \
--window-pos 200 120 \
--window-size 640 480 \
--icon-size 100 \
--icon "VPL3Server.app" 100 300 \
--hide-extension "VPL3Server.app" \
--icon "readme-mac.txt" 100 100\
--app-drop-link 500 300 \
"VPLServer.dmg" \
"VPLServer"
codesign --verify --verbose --timestamp -s "$(APPLE_CERTIFICATE_SIGNING_IDENTITY)" -f "VPLServer.dmg"
rm -Rf "VPLServer"
ServeFile.dmg: Serve\ File.app
rm -Rf "Serve File" $@
mkdir "Serve File"
cp -R "$^" "Serve File"
hdiutil create -srcfolder "Serve File" $@
rm -Rf "Serve File"
.PHONY: Serve\ File.app
Serve\ File.app: setup_serve_via_http.py serve_via_http.py
rm -rf build
python3 setup_serve_via_http.py py2app
.PHONY: oh
oh:
ohcount $(PKGFILES) $(ROOTFILES) $(DOCFILES) $(TOOLSFILES)
## targets to validate js code with closure compiler
# Default closure compiler in current directory, used if closure-compiler isn't found
# Update here or build with "make CLOSURECOMPILER=path" to match your environment
# The current version can be found at https://github.com/google/closure-compiler/wiki/Binary-Downloads
CLOSURECOMPILER ?= closure-compiler-v20190121.jar
CLOSURE = $(shell if which closure-compiler >/dev/null; then echo closure-compiler; else echo java -jar $(CLOSURECOMPILER); fi)
CLOSUREFLAGS = \
--language_in ECMASCRIPT6_STRICT \
--compilation_level ADVANCED_OPTIMIZATIONS \
--use_types_for_optimization \
--warning_level VERBOSE \
--summary_detail_level 2
vpath %.js vpl3tt/doc:vpl3tt/doc/vpl-teacher-tools:vpl3tt/doc/libs/jszip
.PHONY: cc
cc: dashboard-min.js
dashboard-min.js: dummy-defs.js ns.js client.js zipbundle.js dashboard.js translate.js filebrowser.js dashboard-gui.js
$(CLOSURE) $(CLOSUREFLAGS) $^ >$@ || (rm -f $@; false)