-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
52 lines (38 loc) · 871 Bytes
/
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
FUZZ_TARGETS := ./pkg/smartfanunit/proto
all: lint test
.PHONY: run
run:
go run cmd/agent/main.go
.PHONY: lint
lint:
golangci-lint run
.PHONY: test
test:
go test ./... -v
.PHONY: fuzz
fuzz:
@for target in $(FUZZ_TARGETS); do \
go test -fuzz="Fuzz" -fuzztime=5s -fuzzminimizetime=10s $$target; \
done
.PHONY: generate
generate: buf
$(BUF) generate
.PHONY: build-fanunit
build-fanunit:
tinygo build -target=pico -o fanunit.uf2 ./cmd/fanunit/
.PHONY: build-agent
build-agent: generate
goreleaser build --snapshot --clean
.PHONY: snapshot
snapshot:
goreleaser release --snapshot --skip=publish --clean
# Dependencies
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)
BUF ?= $(LOCALBIN)/buf
BUF_VERSION ?= v1.25.0
.PHONY: buf
buf: $(BUF)
$(BUF): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install github.com/bufbuild/buf/cmd/buf@$(BUF_VERSION)