-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (21 loc) · 839 Bytes
/
Makefile
File metadata and controls
28 lines (21 loc) · 839 Bytes
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
build:
@echo "Compiling Go code to Wasm using TinyGo..."
@tinygo build -target=wasi -opt=z -panic=trap -o examples/counter/counter.wasm ./examples/counter
@ls -lh examples/counter/counter.wasm
opt:
@echo "Optimizing Wasm using wasm-opt..."
@wasm-opt -Oz examples/counter/counter.wasm -o examples/counter/counter.opt.wasm
@ls -lh examples/counter/counter.opt.wasm
compress:
@echo "Compressing optimized Wasm using Brotli..."
@brotli -c examples/counter/counter.opt.wasm > examples/counter/counter.wasm.br
@ls -lh examples/counter/counter.wasm.br
all: build opt compress
check-size:
@echo "Checking final compressed size..."
@ls -lh examples/counter/counter.wasm.br
# Add size check logic if needed, e.g., using awk or stat
test:
@echo "Running Go tests..."
@go test ./...
.PHONY: build opt compress all check-size test