-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (39 loc) · 1.57 KB
/
Copy pathMakefile
File metadata and controls
52 lines (39 loc) · 1.57 KB
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
GO ?= $(shell if command -v go >/dev/null 2>&1; then command -v go; elif [ -x /home/free/usr/go/bin/go ]; then printf /home/free/usr/go/bin/go; else printf go; fi)
PKGS ?= ./...
EXAMPLE ?= ./examples/minimal
GOCACHE ?= /tmp/agentui-go-build-cache
.DEFAULT_GOAL := help
.PHONY: help fmt test vet race cross check ci run tidy clean
help:
@printf "agentui make targets:\n"
@printf " make fmt Format Go packages\n"
@printf " make test Run unit tests\n"
@printf " make vet Run go vet\n"
@printf " make race Run tests with the race detector\n"
@printf " make cross Compile-test Linux, macOS, and Windows targets\n"
@printf " make check Run fmt, vet, and tests\n"
@printf " make ci Run vet, tests, and race tests\n"
@printf " make run Run the minimal example\n"
@printf " make tidy Tidy go.mod/go.sum\n"
@printf " make clean Clear Go build and test caches\n"
fmt:
GOCACHE=$(GOCACHE) $(GO) fmt $(PKGS)
test:
GOCACHE=$(GOCACHE) $(GO) test $(PKGS)
vet:
GOCACHE=$(GOCACHE) $(GO) vet $(PKGS)
race:
GOCACHE=$(GOCACHE) $(GO) test -race $(PKGS)
cross:
GOCACHE=$(GOCACHE) GOOS=linux GOARCH=amd64 $(GO) test -exec=/bin/true $(PKGS)
GOCACHE=$(GOCACHE) GOOS=darwin GOARCH=amd64 $(GO) test -exec=/bin/true $(PKGS)
GOCACHE=$(GOCACHE) GOOS=darwin GOARCH=arm64 $(GO) test -exec=/bin/true $(PKGS)
GOCACHE=$(GOCACHE) GOOS=windows GOARCH=amd64 $(GO) test -exec=/bin/true $(PKGS)
check: fmt vet test
ci: vet test race
run:
GOCACHE=$(GOCACHE) $(GO) run $(EXAMPLE)
tidy:
GOCACHE=$(GOCACHE) $(GO) mod tidy
clean:
GOCACHE=$(GOCACHE) $(GO) clean -cache -testcache