Skip to content

Commit

Permalink
Feat: Makefile adds target dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
chripo committed Feb 3, 2023
1 parent 60ec5ad commit 9284351
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down

0 comments on commit 9284351

Please sign in to comment.