| 1 |
NO_COLOR=\033[0m |
| 2 |
OK_COLOR=\033[32;01m |
| 3 |
ERROR_COLOR=\033[31;01m |
| 4 |
WARN_COLOR=\033[33;01m |
| 5 |
DEPS = $(go list -f '{{range .TestImports}}{{.}} {{end}}' ./... | fgrep -v 'winrm') |
| 6 |
|
| 7 |
all: deps |
| 8 |
@mkdir -p bin/ |
| 9 |
@printf "$(OK_COLOR)==> Building$(NO_COLOR)\n" |
| 10 |
@go build github.com/masterzen/winrm |
| 11 |
|
| 12 |
deps: |
| 13 |
@printf "$(OK_COLOR)==> Installing dependencies$(NO_COLOR)\n" |
| 14 |
@go get -d -v ./... |
| 15 |
@echo $(DEPS) | xargs -n1 go get -d |
| 16 |
|
| 17 |
updatedeps: |
| 18 |
go list ./... | xargs go list -f '{{join .Deps "\n"}}' | grep -v github.com/masterzen/winrm | sort -u | xargs go get -f -u -v |
| 19 |
|
| 20 |
clean: |
| 21 |
@rm -rf bin/ pkg/ src/ |
| 22 |
|
| 23 |
format: |
| 24 |
go fmt ./... |
| 25 |
|
| 26 |
ci: deps |
| 27 |
@printf "$(OK_COLOR)==> Testing with Coveralls...$(NO_COLOR)\n" |
| 28 |
"$(CURDIR)/scripts/test.sh" |
| 29 |
|
| 30 |
test: deps |
| 31 |
@printf "$(OK_COLOR)==> Testing...$(NO_COLOR)\n" |
| 32 |
go test ./... |
| 33 |
|
| 34 |
.PHONY: all clean deps format test updatedeps |