Skip to content

Commit

Permalink
Add variables for extra flags to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnjo committed Oct 9, 2019
1 parent a35d5fb commit ae15367
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
EXTRA_DEPFLAGS ?=
EXTRA_GOFLAGS ?=
EXTRA_TESTFLAGS ?=
COVERAGE_FLAGS ?= -cover

all: dep dynconf
.PHONY: all

dep:
dep ensure
dep ensure $(EXTRA_DEPFLAGS)
.PHONY: dep

dynconf:
go build
go build $(EXTRA_GOFLAGS)
.PHONY: dynconf

fmt:
go fmt ./...
.PHONY: fmt

TEST_DIRS = ./pkg
COVERAGE ?= -cover
test:
go test $(COVERAGE) $(TEST_DIRS)
go test $(EXTRA_TESTFLAGS) $(COVERAGE) $(TEST_DIRS)
.PHONY: test

bench:
go test -bench . $(TEST_DIRS)
go test $(EXTRA_TESTFLAGS) -bench . $(TEST_DIRS)
.PHONY: bench

0 comments on commit ae15367

Please sign in to comment.