forked from open-hand/choerodon-cluster-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (38 loc) · 789 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
DOCKER_REGISTRY ?=
IMAGE_PREFIX ?=
SHORT_NAME ?= choerodon-cluster-agent
# go option
GO ?= go
LDFLAGS :=
BINDIR := $(CURDIR)/bin
TAGS :=
.PHONY: all
all: build
.PHONY: build
build:
GOBIN=$(BINDIR) $(GO) install -tags '$(TAGS)' -ldflags '$(LDFLAGS)' github.com/choerodon/choerodon-cluster-agent/...
.PHONY: clean
clean:
rm -f bin/*
HAS_DEP := $(shell command -v dep;)
HAS_GIT := $(shell command -v git;)
.PHONY: bootstrap
bootstrap:
ifndef HAS_DEP
$(GO) get -u github.com/golang/dep/cmd/dep
endif
ifndef HAS_GIT
$(error You must install git)
endif
dep ensure -v
.PHONY: test
test:
$(GO) test ./...
.PHONY: coverage
coverage:
$(GO) test -coverprofile=c.out ./...
$(GO) tool cover -html=c.out
.PHONY: fmt
fmt:
$(GO) fmt
include versioning.mk