-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (30 loc) · 1.17 KB
/
Makefile
File metadata and controls
40 lines (30 loc) · 1.17 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
include ../includes.mk
# the filepath to this repository, relative to $GOPATH/src
repo_path = github.com/deis/deis/client-go
GO_FILES = $(wildcard *.go)
GO_PACKAGES = parser cmd controller/api controller/client $(wildcard controller/models/*) $(wildcard pkg/*)
GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES))
COMPONENT = $(notdir $(repo_path))
IMAGE = $(IMAGE_PREFIX)/$(COMPONENT):$(BUILD_TAG)
build:
CGO_ENABLED=0 godep go build -a -installsuffix cgo -ldflags '-s' -o deis .
@$(call check-static-binary,deis)
install:
godep go install -v .
setup-root-gotools:
sudo GOPATH=/tmp/tmpGOPATH go get -u -v golang.org/x/tools/cmd/cover
sudo GOPATH=/tmp/tmpGOPATH go get -u -v golang.org/x/tools/cmd/vet
sudo rm -rf /tmp/tmpGOPATH
setup-gotools:
go get -u github.com/golang/lint/golint
go get -u golang.org/x/tools/cmd/cover
go get -u golang.org/x/tools/cmd/vet
test: test-style test-unit
test-style:
# display output, then check
$(GOFMT) $(GO_PACKAGES) $(GO_FILES)
@$(GOFMT) $(GO_PACKAGES) $(GO_FILES) | read; if [ $$? == 0 ]; then echo "gofmt check failed."; exit 1; fi
$(GOVET) $(repo_path) $(GO_PACKAGES_REPO_PATH)
$(GOLINT) ./...
test-unit:
$(GOTEST) ./...