1 .PHONY: all clean clean-coverage install install-dependencies install-tools lint test test-verbose test-with-coverage
3 export ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
4 export PKG := github.com/sergi/go-diff
5 export ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
7 $(eval $(ARGS):;@:) # turn arguments into do-nothing targets
13 PKG_TEST := $(PKG)/...
16 all: install-tools install-dependencies install lint test
19 go clean -i $(PKG)/...
20 go clean -i -race $(PKG)/...
22 find $(ROOT_DIR) | grep .coverprofile | xargs rm
24 go install -v $(PKG)/...
26 go get -t -v $(PKG)/...
27 go build -v $(PKG)/...
29 # Install linting tools
30 go get -u -v golang.org/x/lint/...
31 go get -u -v github.com/kisielk/errcheck/...
33 # Install code coverage tools
34 go get -u -v github.com/onsi/ginkgo/ginkgo/...
35 go get -u -v github.com/modocache/gover/...
36 go get -u -v github.com/mattn/goveralls/...
38 $(ROOT_DIR)/scripts/lint.sh
40 go test -race -test.timeout 120s $(PKG_TEST)
42 go test -race -test.timeout 120s -v $(PKG_TEST)
44 ginkgo -r -cover -race -skipPackage="testdata"