-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (24 loc) · 948 Bytes
/
Makefile
File metadata and controls
33 lines (24 loc) · 948 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
28
29
30
31
32
33
.PHONY: build install test vet wasm wasm-serve wasm-dev clean
build:
go build -trimpath -ldflags="-s -w -X main.version=$(VERSION)" -o certkit ./cmd/certkit/
install:
go install -trimpath -ldflags="-s -w -X main.version=$(VERSION)" ./cmd/certkit/
test:
go test -race ./...
vet:
go vet ./...
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
BUILD_YEAR ?= $(shell date +%Y)
wasm:
GOOS=js GOARCH=wasm go build -trimpath \
-ldflags="-s -w -X main.version=$(VERSION) -X main.buildYear=$(BUILD_YEAR)" \
-o web/public/certkit.wasm ./cmd/wasm/
cp "$$(go env GOROOT)/lib/wasm/wasm_exec.js" web/public/wasm_exec.js
wasm-serve: wasm
@echo "Serving at http://localhost:8080"
cd web/public && python3 -m http.server 8080
wasm-dev: wasm
@echo "Serving at http://localhost:8788 (with AIA proxy)"
cd web && npx wrangler pages dev ./public
clean:
rm -f certkit web/public/certkit.wasm web/public/wasm_exec.js