-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile-jsmin
134 lines (124 loc) · 3.28 KB
/
Makefile-jsmin
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
# Copyright 2018-2022 ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE,
# Miniature Mobile Robots group, Switzerland
# Author: Yves Piguet
# Licensed under the 3-Clause BSD License;
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# https://opensource.org/licenses/BSD-3-Clause
COPYRIGHT = /* Copyright 2018-2022 ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE - author Yves Piguet */
# 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
# Default closure --compilation_level value
# Can be set when calling make with "make CLOSURE_COMPILATION_LEVEL=SIMPLE_OPTIMIZATIONS" to
# preserve global names and allow advanced custiomization
CLOSURE_COMPILATION_LEVEL ?= ADVANCED_OPTIMIZATIONS
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 $(CLOSURE_COMPILATION_LEVEL) \
--use_types_for_optimization \
--warning_level VERBOSE \
--summary_detail_level 2
# to debug:
# CLOSUREFLAGS += --compilation_level WHITESPACE_ONLY --formatting=PRETTY_PRINT
JS = \
a3a-ns.js \
a3a-nodebase.js \
a3a-nodeproxy.js \
vpl-ns.js \
vpl-blocktemplate.js \
vpl-blockparam-acc.js \
vpl-block.js \
vpl-emptyblock.js \
vpl-rule.js \
vpl-rule-comment.js \
vpl-uiconfig.js \
vpl-i18n.js \
vpl-dynamic-help.js \
vpl-program.js \
vpl-code.js \
vpl-code-aseba.js \
vpl-code-l2.js \
vpl-code-js.js \
vpl-code-python.js \
vpl-code-asm.js \
vpl-cmd.js \
vpl-app.js \
vpl-ui-validator.js \
vpl-cmd-vpl.js \
vpl-controlbar.js \
vpl-buttons-js.js \
vpl-controlbar-btn.js \
vpl-widgets-js.js \
vpl-program-canvas.js \
css.js \
vpl-css.js \
vpl-css-draw.js \
vpl-canvas.js \
vpl-canvas-scroll.js \
vpl-draw.js \
vpl-blocklibutil.js \
vpl-blocklib.js \
vpl-jsoncode.js \
svg.js \
svg-preparsed.js \
svg-transform.js \
vpl-blocklib-svg.js \
vpl-error.js \
vpl-undo.js \
vpl-html.js \
vpl-aeslfile.js \
vpl-texteditor.js \
vpl-sourceedit.js \
vpl-cmd-src.js \
vpl-ui-svg.js \
vpl-runglue.js \
vpl-htmlpanel.js \
vpl-conv-html.js \
vpl-files.js \
jszip-externs.js \
zipbundle.js \
vpl-load.js \
vpl-com.js \
vpl-keyboard.js \
vpl-textfield.js \
vpl-textfield-input.js \
vpl-kbd-control.js \
vpl-main.js \
vpl-robot.js \
vpl-virtualthymio.js \
compiler-ns.js \
compiler-vm.js \
compiler-dis.js \
compiler-dis-mixed.js \
compiler.js \
compiler-macros.js \
compiler-l2.js \
compiler-macros-l2.js \
compiler-thymio.js \
compiler-asm.js \
inputbuffer.js \
a3a-idmapping.js \
a3a-com.js \
a3a-device.js \
a3a-virtual-thymio.js \
vpl-virtualthymio-a3a.js \
vpl-sim.js \
vpl-obstacles.js \
vpl-sim2d.js \
vpl-cmd-sim.js \
vpl-thymio.js \
vpl-thymio-tdm.js \
json-ws-bridge-api.js \
vpl-thymio-jws.js
vpath %.js src
vpl-min.js: $(JS)
echo "$(COPYRIGHT)" >$@
echo '(function(){' >>$@
$(CLOSURE) $(CLOSUREFLAGS) $^ >>$@ || (rm -f $@; false)
echo '}).call(this);' >>$@
.PHONY: clean
clean:
rm -Rf vpl-min.js