forked from lib-ruby-parser/wasm-bindings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.mk
34 lines (28 loc) · 1.14 KB
/
build.mk
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
define download_file
curl "$(1)" --fail-with-body -LSso "$(2).tmp" && mv "$(2).tmp" "$(2)"
endef
CODEGEN_EXE = codegen/codegen$(EXE)
$(CODEGEN_EXE):
$(call download_file,https://github.com/lib-ruby-parser/lib-ruby-parser/releases/download/codegen-v1.0.1/codegen-x86_64-apple-darwin,$@)
chmod +x $(CODEGEN_EXE)
CLEAN += $(CODEGEN_EXE)
js/index.d.ts: codegen/types.d.ts.liquid $(CODEGEN_EXE)
$(CODEGEN_EXE) --template $< --write-to $@
CLEAN += js/index.d.ts
CODEGEN_FILES += js/index.d.ts
js/nodes.js: codegen/nodes.js.liquid $(CODEGEN_EXE)
$(CODEGEN_EXE) --template $< --write-to $@
CLEAN += js/nodes.js
CODEGEN_FILES += js/nodes.js
js/messages.js: codegen/messages.js.liquid $(CODEGEN_EXE)
$(CODEGEN_EXE) --template $< --write-to $@
CLEAN += js/messages.js
CODEGEN_FILES += js/messages.js
bindings/src/nodes.rs: codegen/nodes.rs.liquid $(CODEGEN_EXE)
$(CODEGEN_EXE) --template $< --write-to $@
CLEAN += bindings/src/nodes.rs
CODEGEN_FILES += bindings/src/nodes.rs
bindings/src/messages.rs: codegen/messages.rs.liquid $(CODEGEN_EXE)
$(CODEGEN_EXE) --template $< --write-to $@
CLEAN += bindings/src/messages.rs
CODEGEN_FILES += bindings/src/messages.rs