gowebdav/Makefile

43 lines
1003 B
Makefile
Raw Permalink Normal View History

2018-05-16 12:23:42 +02:00
BIN := gowebdav
SRC := $(wildcard *.go) cmd/gowebdav/main.go
2014-10-23 10:39:47 +02:00
2018-05-16 12:23:42 +02:00
all: test cmd
2014-10-23 10:39:47 +02:00
2018-05-16 12:23:42 +02:00
cmd: ${BIN}
2014-10-23 10:39:47 +02:00
2018-05-16 12:23:42 +02:00
${BIN}: ${SRC}
go build -o $@ ./cmd/gowebdav
2014-10-23 10:39:47 +02:00
2014-10-23 11:15:28 +02:00
test:
2022-10-16 00:39:27 +02:00
go test -modfile=go_test.mod -v -short -cover ./...
2014-10-23 11:15:28 +02:00
api: .go/bin/godoc2md
2018-05-16 13:52:24 +02:00
@sed '/^## API$$/,$$d' -i README.md
@echo '## API' >> README.md
@$< github.com/studio-b12/gowebdav | sed '/^$$/N;/^\n$$/D' |\
2018-05-16 13:52:24 +02:00
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: .go/bin/gocyclo
2018-05-25 11:26:31 +02:00
gofmt -w -s $(SRC)
2018-05-25 23:26:18 +02:00
@echo
.go/bin/gocyclo -over 15 .
2018-05-25 23:26:18 +02:00
@echo
2022-10-16 00:39:27 +02:00
go vet -modfile=go_test.mod ./...
2018-05-25 11:26:31 +02:00
.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
2014-10-23 10:39:47 +02:00
clean:
2018-05-16 12:23:42 +02:00
@rm -f ${BIN}
2014-10-23 10:39:47 +02:00
2018-05-25 11:26:31 +02:00
.PHONY: all cmd clean test api check