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")
|
|
|
|
|
2016-11-18 00:47:31 +00:00
|
|
|
default: build validation
|
2016-11-05 16:43:00 +00:00
|
|
|
|
|
|
|
.PHONY: validation
|
2016-11-18 00:47:31 +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)
|
2016-11-22 15:57:47 +00:00
|
|
|
@go run ./test/cli.go ./test/cli/*.sh && touch $@
|
2016-11-07 14:53:24 +00:00
|
|
|
|
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
|
|
|
|