diff --git a/Makefile b/Makefile index 70d5dc8..7d8e97d 100644 --- a/Makefile +++ b/Makefile @@ -1,29 +1,29 @@ -all: build test +all: test install -deps: - go get golang.org/x/lint/golint - go get golang.org/x/tools/cmd/cover - go get +# Note: this command will be slightly messy UNLESS we are on a tag, which is +# what we want. +RELEASE_VERSION=$(shell git describe --tags) -build: deps - go build cmd/hostess/hostess.go +install: + go install . + +deps: + go install golang.org/x/lint/golint + go install golang.org/x/tools/cmd/cover -test: +test: deps go test -coverprofile=coverage.out; go tool cover -html=coverage.out -o coverage.html go vet $(PACKAGES) golint $(PACKAGES) -build-all: test - - echo FIXME - exit 1 - -install: - go install . +release: test + GOOS=windows GOARCH=amd64 go build -ldflags "-X main.Version=${RELEASE_VERSION}" -o bin/hostess_windows_amd64.exe . + GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.Version=${RELEASE_VERSION}" -o bin/hostess_macos_amd64 . + GOOS=linux GOARCH=amd64 go build -ldflags "-X main.Version=${RELEASE_VERSION}" -o bin/hostess_linux_amd64 . + GOOS=linux GOARCH=arm go build -ldflags "-X main.Version=${RELEASE_VERSION}" -o bin/hostess_linux_arm . clean: - rm -f ./hostess - rm -f ./hostess_* rm -f ./coverage.* + rm -rf ./bin/ -.PHONY: all deps build test gox build-all install clean +.PHONY: all install deps test release clean