Makefile 694 B

12345678910111213141516171819202122232425
  1. # Project packages.
  2. PACKAGES=$(shell go list ./...)
  3. # Flags passed to `go test`
  4. BUILDFLAGS ?=
  5. TESTFLAGS ?=
  6. .PHONY: all build test coverage
  7. .DEFAULT: all
  8. all: build
  9. build: ## no binaries to build, so just check compilation suceeds
  10. go build ${BUILDFLAGS} ./...
  11. test: ## run tests
  12. go test ${TESTFLAGS} ./...
  13. coverage: ## generate coverprofiles from the unit tests
  14. rm -f coverage.txt
  15. go test ${TESTFLAGS} -cover -coverprofile=cover.out ./...
  16. .PHONY: help
  17. help:
  18. @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_\/%-]+:.*?##/ { printf " \033[36m%-27s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)