forked from mherkender/lua.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (27 loc) · 993 Bytes
/
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
# ex:noexpandtab:softtabstop=0
CLOSURE_COMPILER=closurecompiler/compiler.jar
NODE=node
GENERATED_FILES=lua2js lua.js lua.as lua.min.js lua+parser.js lua+parser.min.js
all: $(GENERATED_FILES) luajs.zip
lua2js: src/lua2js_start src/lua_parser.js src/lua2js_end
cat $^ > $@
chmod +x $@ || rm -f $@
src/lua_parser.js: src/build_lua_parser.js src/lua.jison $(shell find jison)
cd . && $(NODE) $<
lua.js: src/lua_header.js src/lualib.js
cat $^ > $@
lua.as: src/lua_header.as src/lualib.js
cat $^ > $@
lua.min.js: lua.js
java -jar $(CLOSURE_COMPILER) --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file $@ --js $<
lua+parser.js: src/lua_header.js src/lua_parser.js src/lualib.js
cat $^ > $@
# TODO: SIMPLE_OPTIMIZATIONS is breaking lua_load
lua+parser.min.js: lua+parser.js
java -jar $(CLOSURE_COMPILER) --compilation_level WHITESPACE_ONLY --js_output_file $@ --js $<
luajs.zip: $(GENERATED_FILES)
zip $@ $^
clean:
rm -rf $(GENERATED_FILES)
.PHONY: all clean
.SUFFIXES: