2016-11-05 16:43:00 +00:00
|
|
|
|
2016-11-07 14:53:24 +00:00
|
|
|
BUILD := gomtree
|
|
|
|
CWD := $(shell pwd)
|
2016-11-05 16:43:00 +00:00
|
|
|
SOURCE_FILES := $(shell find . -type f -name "*.go")
|
|
|
|
|
|
|
|
default: validation build
|
|
|
|
|
|
|
|
.PHONY: validation
|
2016-11-07 14:53:24 +00:00
|
|
|
validation: test lint vet .cli.test
|
2016-11-05 16:43:00 +00:00
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test: .test
|
|
|
|
|
|
|
|
.test: $(SOURCE_FILES)
|
|
|
|
go test -v ./... && touch $@
|
|
|
|
|
|
|
|
.PHONY: lint
|
|
|
|
lint: .lint
|
|
|
|
|
|
|
|
.lint: $(SOURCE_FILES)
|
|
|
|
golint -set_exit_status ./... && touch $@
|
|
|
|
|
|
|
|
.PHONY: vet
|
|
|
|
vet: .vet
|
|
|
|
|
|
|
|
.vet: $(SOURCE_FILES)
|
|
|
|
go vet ./... && touch $@
|
|
|
|
|
2016-11-07 14:53:24 +00:00
|
|
|
.PHONY: cli.test
|
|
|
|
cli.test: .cli.test
|
|
|
|
|
|
|
|
.cli.test: $(BUILD) $(wildcard ./test/cli/*.sh)
|
|
|
|
@ for test in ./test/cli/*.sh ; do \
|
|
|
|
bash $$test $(CWD) ; \
|
|
|
|
done && touch $@
|
|
|
|
|
2016-11-05 16:43:00 +00:00
|
|
|
.PHONY: build
|
2016-11-07 14:53:24 +00:00
|
|
|
build: $(BUILD)
|
2016-11-05 16:43:00 +00:00
|
|
|
|
2016-11-07 14:53:24 +00:00
|
|
|
$(BUILD): $(SOURCE_FILES)
|
|
|
|
go build ./cmd/$(BUILD)
|
2016-11-05 16:43:00 +00:00
|
|
|
|
|
|
|
clean:
|
2016-11-07 14:53:24 +00:00
|
|
|
rm -rf $(BUILD) .test .vet .lint .cli.test
|
2016-11-05 16:43:00 +00:00
|
|
|
|