-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (36 loc) · 1.66 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
EXAMPLE_PORT:=0
OUT_DIRS=build dist bin test-results py/dist py/wheelhouse
default: help
all: js go_cli ## Build everything.
js: build_ts ## Build the javascript client.
py: build_py ## Build the python client.
build_ts: run_build_js
npm run build:types
run_build_js: bin_build_js wasm go_wasm_exec
bin/build_js
bin_build_js:
go build -trimpath -o ./bin/build_js ./cmd/build_js
wasm: ## Build the WASM client.
GOOS=js GOARCH=wasm go build -trimpath -o ./build/pbc.wasm ./cmd/worker
go_cli: ## Build the golang CLI client.
go build -trimpath -o ./bin/pbc ./cmd/standalone
go_wasm_exec:
cp "$(shell go env GOROOT)/misc/wasm/wasm_exec.js" ./build/
run_example: bin_build_js wasm go_wasm_exec ## Run example server
cp example/browser/* dist/
bin/build_js -s -p $(EXAMPLE_PORT)
build_py:
cd py && hatch build -t wheel
python_wheels:
pipx run cibuildwheel --platform linux --archs x86_64 --output-dir build/wheelhouse py
pbupdate: ## Update the controller dependency (to latest develop branch version)
GOPROXY=direct go get -u github.com/momentum-xyz/ubercontroller/pkg/posbus@develop && go mod vendor
test: ## Run tests
go test -v -outputdir test-results -coverpkg ./pbc/... -coverprofile coverage.out ./...
clean: ## Clean all generated build artifacts.
rm -rf $(OUT_DIRS)
help: ## This help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":[^:]*?## "}; {printf "\033[38;5;69m%-30s\033[38;5;38m %s\033[0m\n", $$1, $$2}'
.PHONY: default all js build_ts run_build_js bin_build_js wasm go_cli go_wasm_exec run_example pbupdate test clean help
# 'precreate' out output directories after parsing above makefile:
$(shell mkdir -p $(OUT_DIRS))