forked from jackhexed/poke
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
86 lines (69 loc) · 2.24 KB
/
Copy pathmakefile
File metadata and controls
86 lines (69 loc) · 2.24 KB
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
SHELL := /bin/bash
.PHONY: extern parser-bench parser-profile parser-stat parser-flame clean
codegen = 0
ifneq ($(codegen), 0)
codegenflag = --codegen
else
codegenflag =
endif
parser = "parser"
lexer = "lexer"
files = cat extern/list.txt
rate = 10000
out = $(parser)
limit = 10
extern:
@rm -rf extern
@for url in $$(cat extern.txt); do \
echo "downloading $$url"; \
curl -s -L $$url -o extern.zip; \
echo "unzipping $$url"; \
unzip -qq -o extern.zip -d extern; \
done
@rm extern.zip
@# remove all non-luau files and empty directories
@find "extern" -type f ! \( -name "*.lua" -o -name "*.luau" \) -delete
@find "extern" -type d -empty -delete
@# remove specific problematic files
@rm -r extern/NevermoreEngine-main/tools
@rm -r extern/Adonis-master/Loader/Config/Plugins
@rm -r "extern/Adonis-master/MainModule/Client/UI/Windows XP"
@rm "extern/Adonis-master/MainModule/Client/Dependencies/Theming_Info [Read].luau"
@echo "return {" >> files.luau
@# modify all files to return a string of themselves
@for file in $$(find "extern" -type f); do \
content=$$(cat "$$file"); \
echo "local str = [===[$$content]===]; return { str = str }" > "$$file"; \
echo " '$$file'," >> files.luau; \
done
@echo "}" >> files.luau
@mv files.luau extern/files.luau
parser-bench:
luau scripts/parserbench.luau $(codegenflag) -a $(parser)
parser-profile:
@mkdir profile -p
luau scripts/parserbench.luau $(codegenflag) --profile=$(rate) -a $(parser)
@mv profile.out profile/$(out).out
parser-stats: parser-profile
@chmod +x scripts/perfstat.py
@scripts/perfstat.py profile/$(out).out --limit=$(limit)
parser-flame: parser-profile
@chmod +x scripts/perfgraph.py
@scripts/perfgraph.py profile/$(out).out > profile/$(out).svg
lexer-bench:
luau scripts/lexerbench.luau $(codegenflag) -a $(lexer)
lexer-profile:
@mkdir profile -p
luau scripts/lexerbench.luau $(codegenflag) --profile=$(rate) -a $(lexer)
@mv profile.out profile/$(out).out
lexer-stats: lexer-profile
@chmod +x scripts/perfstat.py
@scripts/perfstat.py profile/$(out).out --limit=$(limit)
lexer-flame: lexer-profile
@chmod +x scripts/perfgraph.py
@scripts/perfgraph.py profile/$(out).out > profile/$(out).svg
clean:
@rm -r profile
@rm -r scripts/__pycache__
@rm -r extern
@echo "cleaned"