forked from jani-nykanen/ghosted
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmakefile
70 lines (42 loc) · 1.01 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
JS_FILES := $(wildcard js/*.js) $(wildcard js/*/*.js) $(wildcard js/*/*/*.js)
LEVEL_SRC_PATH := src/leveldata.ts
###########################
all: js
.PHONY: js
js:
tsc
watch:
tsc -w
server:
python3 -m http.server
linecount:
find . -name '*.ts' | xargs wc -l
###########################
.PHONY: closure
closure:
rm -rf ./temp
mkdir -p temp
java -jar $(CLOSURE_PATH) --js $(JS_FILES) --js_output_file temp/out.js --compilation_level ADVANCED_OPTIMIZATIONS --language_out ECMASCRIPT_2020
compress: js closure
.PHONY: pack
pack:
mkdir -p temp
cp templates/index.html temp/index.html
cp f.png temp/f.png
cp g.png temp/g.png
.PHONY: zip
zip:
(cd temp; zip -r ../dist.zip .)
advzip -z dist.zip
wc -c dist.zip
.PHONY: clear_temp
clear_temp:
rm -rf ./temp
.PHONY: dist
dist: compress pack zip clear_temp
###########################
.PHONY: levels
levels:
echo -n "export const LEVEL_DATA : string[] = " > $(LEVEL_SRC_PATH)
./levels/convert.py >> $(LEVEL_SRC_PATH)
###########################