Skip to content

Commit

Permalink
Bump version to 9.3.3. Fix issues with make build calling make vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
Jguer committed Oct 5, 2019
1 parent 769aee7 commit fdcfeba
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ PREFIX := /usr/local

MAJORVERSION := 9
MINORVERSION := 3
PATCHVERSION := 2
PATCHVERSION := 3
VERSION ?= ${MAJORVERSION}.${MINORVERSION}.${PATCHVERSION}

GOFLAGS := -v
GOFLAGS := -v -mod=vendor
EXTRA_GOFLAGS ?=
LDFLAGS := $(LDFLAGS) -X "main.version=${VERSION}"

RELEASE_DIR := ${PKGNAME}_${VERSION}_${ARCH}
PACKAGE := $(RELEASE_DIR).tar.gz
SOURCES ?= $(shell find . -path ./vendor -prune -o -name "*.go" -type f)
SOURCES ?= $(shell find . -name "*.go" -type f ! -path "./vendor/*")

.PHONY: all
all: | clean release
Expand All @@ -28,14 +28,14 @@ default: build

.PHONY: clean
clean:
$(GO) clean -i ./...
$(GO) clean $(GOFLAGS) -i ./...
rm -rf $(BIN) $(PKGNAME)_$(VERSION)_*

.PHONY: test
test: test-vendor
$(GO) vet ./...
test:
$(GO) vet $(GOFLAGS) ./...
@test -z "$$(gofmt -l *.go)" || (echo "Files need to be linted. Use make fmt" && false)
$(GO) test -mod=vendor --race -covermode=atomic -v . ./pkg/...
$(GO) test $(GOFLAGS) --race -covermode=atomic . ./pkg/...

.PHONY: build
build: $(BIN)
Expand All @@ -44,7 +44,7 @@ build: $(BIN)
release: $(PACKAGE)

$(BIN): $(SOURCES)
$(GO) build -mod=vendor -ldflags '-s -w $(LDFLAGS)' $(GOFLAGS) $(EXTRA_GOFLAGS) -o $@
$(GO) build $(GOFLAGS) -ldflags '-s -w $(LDFLAGS)' $(EXTRA_GOFLAGS) -o $@

$(RELEASE_DIR):
mkdir $(RELEASE_DIR)
Expand Down Expand Up @@ -82,6 +82,11 @@ test-vendor: vendor
exit 1; \
fi;

.PHONY: fmt
fmt:
#go fmt -mod=vendor $(GOFILES) ./... Doesn't work yet but will be supported soon
gofmt -s -w $(SOURCES)

.PHONY: vendor
vendor:
$(GO) mod tidy && $(GO) mod vendor
Expand Down

0 comments on commit fdcfeba

Please sign in to comment.