gowebdav/Makefile

34 lines
694 B
Makefile
Raw 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:
2018-05-25 23:26:18 +02:00
go test -v --short ./...
2014-10-23 11:15:28 +02:00
2018-05-16 13:52:24 +02:00
api:
@sed '/^## API$$/,$$d' -i README.md
@echo '## API' >> README.md
@godoc2md 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
2018-05-25 11:26:31 +02:00
check:
gofmt -w -s $(SRC)
2018-05-25 23:26:18 +02:00
@echo
2018-05-25 11:26:31 +02:00
gocyclo -over 15 .
2018-05-25 23:26:18 +02:00
@echo
golint ./...
2018-05-25 11:26:31 +02:00
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