diff --git a/Makefile b/Makefile index da4be25..48dbb4e 100644 --- a/Makefile +++ b/Makefile @@ -11,22 +11,31 @@ ${BIN}: ${SRC} test: go test -modfile=go_test.mod -v -short -cover ./... -api: +api: .go/bin/godoc2md @sed '/^## API$$/,$$d' -i README.md @echo '## API' >> README.md - @godoc2md github.com/studio-b12/gowebdav | sed '/^$$/N;/^\n$$/D' |\ + @$< github.com/studio-b12/gowebdav | sed '/^$$/N;/^\n$$/D' |\ sed '2d' |\ sed 's/\/src\/github.com\/studio-b12\/gowebdav\//https:\/\/github.com\/studio-b12\/gowebdav\/blob\/master\//g' |\ sed 's/\/src\/target\//https:\/\/github.com\/studio-b12\/gowebdav\/blob\/master\//g' |\ sed 's/^#/##/g' >> README.md -check: +check: .go/bin/gocyclo gofmt -w -s $(SRC) @echo - gocyclo -over 15 . + .go/bin/gocyclo -over 15 . @echo go vet -modfile=go_test.mod ./... + +.go/bin/godoc2md: + @mkdir -p $(@D) + @GOPATH="$(CURDIR)/.go" go install github.com/davecheney/godoc2md@latest + +.go/bin/gocyclo: + @mkdir -p $(@D) + @GOPATH="$(CURDIR)/.go" go install github.com/fzipp/gocyclo/cmd/gocyclo@latest + clean: @rm -f ${BIN}