Makefile 839 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Project-specific variables
  2. CONVEY_PORT ?= 9042
  3. # Common variables
  4. SOURCES := $(shell find . -type f -name "*.go")
  5. COMMANDS := $(shell go list ./... | grep -v /vendor/ | grep /cmd/)
  6. PACKAGES := $(shell go list ./... | grep -v /vendor/ | grep -v /cmd/)
  7. GOENV ?= GO15VENDOREXPERIMENT=1
  8. GO ?= $(GOENV) go
  9. GODEP ?= $(GOENV) godep
  10. USER ?= $(shell whoami)
  11. all: build
  12. .PHONY: build
  13. build:
  14. echo "nothing to do"
  15. .PHONY: test
  16. test:
  17. $(GO) get -t .
  18. $(GO) test -v .
  19. .PHONY: godep-save
  20. godep-save:
  21. $(GODEP) save $(PACKAGES) $(COMMANDS)
  22. .PHONY: re
  23. re: clean all
  24. .PHONY: convey
  25. convey:
  26. $(GO) get github.com/smartystreets/goconvey
  27. goconvey -cover -port=$(CONVEY_PORT) -workDir="$(realpath .)" -depth=1
  28. .PHONY: cover
  29. cover: profile.out
  30. profile.out: $(SOURCES)
  31. rm -f $@
  32. $(GO) test -covermode=count -coverpkg=. -coverprofile=$@ .