-
Notifications
You must be signed in to change notification settings - Fork 54
/
Makefile
59 lines (44 loc) · 1.19 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
# 版权 @2019 凹语言 作者。保留所有权利。
.PHONY: wa hello prime build-wasm ci-test-all clean
GOBIN = ./build/bin/wa
DOCKER_VOLUME=-v $(shell pwd):/root
wa:
go build -o $(GOBIN)
@echo "Done building."
@echo "Run \"$(GOBIN)\" to launch wa."
hello:
go install
cd waroot && go run ../main.go run hello.wa
prime:
cd waroot && go run ../main.go run examples/prime
build-wasm:
GOARCH=wasm GOOS=js go build -o wa.out.wasm ./main_wasm.go
build-docker:
go run ./builder
docker build -t wa-lang/wa .
docker-run:
docker run --platform linux/amd64 --rm -it ${DOCKER_VOLUME} wa-lang/wa
ci-test-all:
go install
go test ./...
@echo "== std test begin =="
go run main.go test std
@echo "== std ok =="
go run main.go run ./waroot/hello.wa
cd waroot && go run ../main.go run hello.wa
make -C ./waroot/examples ci-test-all
wa -v
wasm-js:
-@rm ./wa.wasm
@mkdir -p ./docs/wa-js
GOOS=js GOARCH=wasm go build -o wa.wasm
mv wa.wasm ./docs/wa-js
cd ./docs/wa-js && zip wa.wasm.zip wa.wasm
wasm-wasip1:
-@rm ./wa.wasm
@mkdir -p ./docs/wa-wasip1
GOOS=wasip1 GOARCH=wasm go build -o wa.wasm
mv wa.wasm ./docs/wa-wasip1
cd ./docs/wa-wasip1 && zip wa.wasm.zip wa.wasm
clean:
-rm a.out*