-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (45 loc) · 1.8 KB
/
Makefile
File metadata and controls
59 lines (45 loc) · 1.8 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
53
54
55
56
57
58
59
lint: lint/go
.PHONY: lint
lint/go:
golangci-lint run
.PHONY: lint/go
test-clean:
go clean -testcache
.PHONY: test-clean
test: test-clean
gotestsum -- -v -short -coverprofile coverage ./...
.PHONY: test
coverage:
go tool cover -func=coverage
.PHONY: coverage
gen:
bash ./fixtures/generate.bash
.PHONY: gen
upload:
bash ./fixtures/upload.bash
.PHONY: gen
TAG=$(shell git describe --always)
GO_SRC=$(shell find . -name '*.go' -type f)
LDFLAGS=-ldflags "-X github.com/coder/code-marketplace/buildinfo.tag=$(TAG)"
$(shell mkdir -p bin)
# Individual build targets for each OS/arch combination
bin/code-marketplace-darwin-amd64: $(GO_SRC) go.mod go.sum
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o "$@" ./cmd/marketplace/main.go
bin/code-marketplace-darwin-arm64: $(GO_SRC) go.mod go.sum
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o "$@" ./cmd/marketplace/main.go
bin/code-marketplace-linux-amd64: $(GO_SRC) go.mod go.sum
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o "$@" ./cmd/marketplace/main.go
bin/code-marketplace-linux-arm64: $(GO_SRC) go.mod go.sum
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o "$@" ./cmd/marketplace/main.go
bin/code-marketplace-windows-amd64: $(GO_SRC) go.mod go.sum
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o "$@" ./cmd/marketplace/main.go
bin/code-marketplace-windows-arm64: $(GO_SRC) go.mod go.sum
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build $(LDFLAGS) -o "$@" ./cmd/marketplace/main.go
# Main build target - builds all platforms
build: bin/code-marketplace-darwin-amd64 \
bin/code-marketplace-darwin-arm64 \
bin/code-marketplace-linux-amd64 \
bin/code-marketplace-linux-arm64 \
bin/code-marketplace-windows-amd64 \
bin/code-marketplace-windows-arm64
.PHONY: build