github.com/greenboxal/deis@v1.12.1/deisctl/Makefile (about) 1 include ../includes.mk 2 3 # the filepath to this repository, relative to $GOPATH/src 4 repo_path = github.com/deis/deis/deisctl 5 6 GO_FILES = $(wildcard *.go) 7 GO_PACKAGES = backend client cmd config units utils 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' . 15 16 installer: 17 rm -rf dist && mkdir -p dist 18 CGO_ENABLED=0 godep go build -a -installsuffix cgo -ldflags '-s' -o dist/deisctl . 19 @if [ ! -d makeself ]; then git clone -b single-binary https://github.com/deis/makeself.git; fi 20 PATH=./makeself:$$PATH BINARY=deisctl makeself.sh --bzip2 --current --nox11 dist \ 21 dist/deisctl-`cat deis-version`-`go env GOOS`-`go env GOARCH`.run "Deis Control Utility" \ 22 "./deisctl refresh-units \ 23 && echo \ 24 && echo 'deisctl is in the current directory and unit files are' \ 25 && echo 'in \$$HOME/.deis/units. Please move deisctl to a' \ 26 && echo 'directory in your search PATH.' \ 27 && echo \ 28 && echo 'See http://docs.deis.io/ for documentation.' \ 29 && echo" 30 31 install: 32 godep go install -v . 33 34 test: test-style test-unit 35 36 test-style: 37 # display output, then check 38 $(GOFMT) $(GO_PACKAGES) $(GO_FILES) 39 @$(GOFMT) $(GO_PACKAGES) $(GO_FILES) | read; if [ $$? == 0 ]; then echo "gofmt check failed."; exit 1; fi 40 $(GOVET) $(repo_path) $(GO_PACKAGES_REPO_PATH) 41 $(GOLINT) ./... 42 43 test-unit: 44 # TODO: remove GOMAXPROCS=1 when concurrent stdout issues are fixed 45 GOMAXPROCS=1 $(GOTEST) ./...