Clean up the Makefile

This commit is contained in:
Cosmin Cojocar 2018-04-27 14:45:29 +02:00
parent 639f64d421
commit 0abfbefa02

View file

@ -1,7 +1,5 @@
GIT_TAG?= $(shell git describe --always --tags) GIT_TAG?= $(shell git describe --always --tags)
BUILD_DATE = $(shell date +%Y-%m-%d)
BIN = gas BIN = gas
BUILD_CMD = go build -ldflags "-X main.Version=${VERSION} -X main.GitTag=${GIT_TAG} -X main.BuildDate=${BUILD_DATE}" -o build/$(BIN)-$(VERSION)-$${GOOS}-$${GOARCH} ./cmd/gas/ &
FMT_CMD = $(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr) FMT_CMD = $(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr)
IMAGE_REPO = docker.io IMAGE_REPO = docker.io
@ -9,21 +7,26 @@ default:
$(MAKE) bootstrap $(MAKE) bootstrap
$(MAKE) build $(MAKE) build
bootstrap:
dep ensure
test: bootstrap test: bootstrap
test -z '$(FMT_CMD)' test -z '$(FMT_CMD)'
go vet $(go list ./... | grep -v /vendor/) go vet $(go list ./... | grep -v /vendor/)
golint -set_exit_status $(shell go list ./... | grep -v vendor) golint -set_exit_status $(shell go list ./... | grep -v vendor)
gas ./... gas ./...
ginkgo -r -v ginkgo -r -v
bootstrap:
dep ensure
build: build:
go build -o $(BIN) ./cmd/gas/ go build -o $(BIN) ./cmd/gas/
clean: clean:
rm -rf build vendor dist rm -rf build vendor dist
rm -f release image bootstrap $(BIN) rm -f release image bootstrap $(BIN)
release: bootstrap release: bootstrap
goreleaser release --skip-publish @echo "Releasing the gas binary..."
goreleaser release
image: release image: release
@echo "Building the Docker image..." @echo "Building the Docker image..."