frostfs-api/Makefile

37 lines
1.2 KiB
Makefile
Raw Normal View History

2020-03-31 07:36:51 +00:00
NETMAP_VERSION=v1.7.0
2020-01-30 11:41:24 +00:00
GOGOPROTO_VERSION=v1.3.1
NETMAP_URL=https://github.com/nspcc-dev/netmap/archive/$(NETMAP_VERSION).tar.gz
GOGOPROTO_URL=https://github.com/gogo/protobuf/archive/$(GOGOPROTO_VERSION).tar.gz
.PHONY: deps docgen
deps:
2020-04-20 09:03:55 +00:00
@echo "⇒ Prepare"
2020-01-30 11:41:24 +00:00
@rm -rf ./vendor/github.com/gogo/protobuf
@rm -rf ./vendor/github.com/nspcc-dev/netmap
@mkdir -p ./vendor/github.com/gogo/protobuf
@mkdir -p ./vendor/github.com/nspcc-dev/netmap
2020-04-20 09:03:55 +00:00
@echo "⇒ Download"
2020-01-30 11:41:24 +00:00
@curl -sL -o ./vendor/gogo.tar.gz $(GOGOPROTO_URL)
@curl -sL -o ./vendor/netmap.tar.gz $(NETMAP_URL)
2020-04-20 09:03:55 +00:00
@echo "⇒ Vendoring"
2020-01-30 11:41:24 +00:00
@tar -xzf ./vendor/gogo.tar.gz --strip-components 1 -C ./vendor/github.com/gogo/protobuf
@tar -xzf ./vendor/netmap.tar.gz --strip-components 1 -C ./vendor/github.com/nspcc-dev/netmap
2020-04-20 09:03:55 +00:00
@echo "⇒ Cleanup"
2020-01-30 11:41:24 +00:00
@rm ./vendor/gogo.tar.gz
@rm ./vendor/netmap.tar.gz
# Regenerate documentation for protot files:
docgen: deps
@for f in `find . -type f -name '*.proto' -not -path './vendor/*' -exec dirname {} \; | sort -u `; do \
echo "${B}${G}⇒ Documentation for $$(basename $$f) ${R}"; \
protoc \
--doc_opt=.github/markdown.tmpl,$${f}.md \
--proto_path=.:./vendor:/usr/local/include \
--doc_out=proto-docs/ $${f}/*.proto; \
done