github.com/dustinrc/deis@v1.10.1-0.20150917223407-0894a5fb979e/client/Makefile (about) 1 include ../includes.mk 2 3 # the filepath to this repository, relative to $GOPATH/src 4 repo_path = github.com/deis/deis/client 5 6 GO_FILES = $(wildcard *.go) 7 GO_PACKAGES = parser cmd controller/api controller/client $(wildcard controller/models/*) $(wildcard pkg/*) 8 GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES)) 9 10 COMPONENT = $(notdir $(repo_path)) 11 IMAGE = $(IMAGE_PREFIX)/$(COMPONENT):$(BUILD_TAG) 12 13 build: 14 CGO_ENABLED=0 godep go build -a -installsuffix cgo -ldflags '-s' -o deis . 15 @$(call check-static-binary,deis) 16 17 install: build 18 cp deis $$GOPATH/bin 19 20 installer: build 21 @if [ ! -d makeself ]; then git clone -b single-binary https://github.com/deis/makeself.git; fi 22 PATH=./makeself:$$PATH BINARY=deis makeself.sh --bzip2 --current --nox11 . \ 23 deis-cli-`cat deis-version`-`go env GOOS`-`go env GOARCH`.run \ 24 "Deis CLI" "echo \ 25 && echo 'deis is in the current directory. Please' \ 26 && echo 'move deis to a directory in your search PATH.' \ 27 && echo \ 28 && echo 'See http://docs.deis.io/ for documentation.' \ 29 && echo" 30 31 setup-root-gotools: 32 sudo GOPATH=/tmp/tmpGOPATH go get -u -v golang.org/x/tools/cmd/cover 33 sudo GOPATH=/tmp/tmpGOPATH go get -u -v golang.org/x/tools/cmd/vet 34 sudo rm -rf /tmp/tmpGOPATH 35 36 setup-gotools: 37 go get -u github.com/golang/lint/golint 38 go get -u golang.org/x/tools/cmd/cover 39 go get -u golang.org/x/tools/cmd/vet 40 41 test: test-style test-unit 42 43 test-style: 44 # display output, then check 45 $(GOFMT) $(GO_PACKAGES) $(GO_FILES) 46 @$(GOFMT) $(GO_PACKAGES) $(GO_FILES) | read; if [ $$? == 0 ]; then echo "gofmt check failed."; exit 1; fi 47 $(GOVET) $(repo_path) $(GO_PACKAGES_REPO_PATH) 48 $(GOLINT) ./... 49 50 test-unit: 51 $(GOTEST) ./...