| 1 |
EXAMPLES := $(shell find examples/ -maxdepth 1 -type d -exec sh -c 'echo $(basename {})' \;) |
| 2 |
EXLIST := $(subst examples/,,$(EXAMPLES)) |
| 3 |
|
| 4 |
ifeq ($(TRAVIS_BUILD_DIR),) |
| 5 |
GOPATH := $(GOPATH) |
| 6 |
else |
| 7 |
GOPATH := $(GOPATH):$(TRAVIS_BUILD_DIR) |
| 8 |
endif |
| 9 |
|
| 10 |
all: chmod clean lint test coverage $(EXLIST) |
| 11 |
|
| 12 |
# this chmod is a side effect of some windows-development related issues |
| 13 |
chmod: |
| 14 |
chmod +x script/* |
| 15 |
|
| 16 |
lint: |
| 17 |
@script/lint |
| 18 |
|
| 19 |
test: |
| 20 |
@script/test |
| 21 |
|
| 22 |
coverage: |
| 23 |
@script/coverage |
| 24 |
|
| 25 |
$(EXLIST): |
| 26 |
@echo $@ |
| 27 |
@go test -v ./examples/$@ |
| 28 |
@gocov test ./examples/$@ | gocov report |
| 29 |
|
| 30 |
clean: |
| 31 |
@rm -rf bin/ pkg/ |
| 32 |
|
| 33 |
.PHONY: all chmod clean lint test coverage $(EXLIST) |