@ -24,12 +24,17 @@ GOFLAGS :=
BINDIR := $( CURDIR) /bin
BINARIES := k3d
# Go Package required
PKG_GOX := github.com/mitchellh/gox
PKG_GOLANGCI_LINT := github.com/golangci/golangci-lint/cmd/golangci-lint
export GO111MODULE = on
# go source files, ignore vendor directory
SRC = $( shell find . -type f -name '*.go' -not -path "./*/*" )
.PHONY : all build build -cross clean fmt simplify check
.PHONY : all build build -cross clean fmt simplify check extra -clean
all : clean fmt check build
@ -43,6 +48,10 @@ build-cross:
clean :
@rm -rf $( BINDIR) _dist/
extra-clean : clean
go clean -i $( PKG_GOX)
go clean -i $( PKG_GOLANGCI_LINT)
fmt :
@gofmt -l -w $( SRC)
@ -59,8 +68,8 @@ HAS_GOX := $(shell command -v gox 2> /dev/null)
HAS_GOLANGCI := $( shell command -v golangci-lint 2> /dev/null)
i f n d e f H A S _ G O X
go get -u github.com/mitchellh/gox
go get -u $( PKG_GOX)
e n d i f
i f n d e f H A S _ G O L A N G C I
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
go get -u $( PKG_GOLANGCI_LINT)
e n d i f