forked from gardener/cert-management
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (35 loc) · 1022 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
EXECUTABLE=cert-controller-manager
PROJECT=github.com/gardener/cert-management
VERSION=$(shell cat VERSION)
.PHONY: revendor
revendor:
@GO111MODULE=on go mod vendor
@GO111MODULE=on go mod tidy
.PHONY: check
check:
@.ci/check
.PHONY: build
build:
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o $(EXECUTABLE) \
-mod=vendor \
-ldflags "-X main.version=$(VERSION)-$(shell git rev-parse HEAD)"\
./cmd/cert-controller-manager
.PHONY: build-local
build-local:
@CGO_ENABLED=0 GO111MODULE=on go build -o $(EXECUTABLE) \
-mod=vendor \
-ldflags "-X main.version=$(VERSION)-$(shell git rev-parse HEAD)"\
./cmd/cert-controller-manager
.PHONY: release
release:
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o $(EXECUTABLE) \
-a \
-mod=vendor \
-ldflags "-w -X main.version=$(VERSION)" \
./cmd/cert-controller-manager
.PHONY: test
test:
GO111MODULE=on go test -mod=vendor ./pkg/...
.PHONY: generate
generate:
@./hack/generate-code