-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (19 loc) · 823 Bytes
/
Makefile
File metadata and controls
28 lines (19 loc) · 823 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
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -s -w -X main.version=$(VERSION)
BIN := bin/helm
.PHONY: build build-linux build-linux-arm64 build-darwin build-darwin-arm64 build-all clean test
build:
go build -ldflags "$(LDFLAGS)" -o $(BIN) .
build-linux:
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o $(BIN)-linux-amd64 .
build-linux-arm64:
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o $(BIN)-linux-arm64 .
build-darwin:
GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o $(BIN)-darwin-amd64 .
build-darwin-arm64:
GOOS=darwin GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o $(BIN)-darwin-arm64 .
build-all: build-linux build-linux-arm64 build-darwin build-darwin-arm64
clean:
rm -rf bin/
test:
go test ./... -race -count=1