2023-10-31 14:03:31 +00:00
|
|
|
.PHONY: requirements common gw api integration stream
|
2022-04-06 20:18:32 +00:00
|
|
|
|
|
|
|
PROTOC := python -m grpc_tools.protoc
|
2024-04-01 13:27:15 +00:00
|
|
|
PROTOC_ARGS := -I=proto --python_out=src --grpc_python_out=src --pyi_out=src
|
2022-04-06 20:18:32 +00:00
|
|
|
PACKAGE_NAME := import \"chirpstack-api/
|
|
|
|
|
2023-10-31 14:03:31 +00:00
|
|
|
all: requirements pre-build common gw api integration stream
|
2022-04-06 20:18:32 +00:00
|
|
|
|
|
|
|
requirements:
|
|
|
|
pip install grpcio-tools
|
|
|
|
|
|
|
|
# See: https://github.com/protocolbuffers/protobuf/issues/7061
|
|
|
|
pre-build:
|
|
|
|
rm -rf proto
|
|
|
|
mkdir -p proto/chirpstack-api
|
|
|
|
cp -r ../proto/* proto/chirpstack-api/
|
2024-04-01 13:27:15 +00:00
|
|
|
mv proto/chirpstack-api/google proto/google
|
2022-04-06 20:18:32 +00:00
|
|
|
sed -i 's@^import "common/@$(PACKAGE_NAME)common/@g' `find proto/chirpstack-api -type f -name "*.proto*"`
|
|
|
|
sed -i 's@^import "gw/@$(PACKAGE_NAME)gw/@g' `find proto/chirpstack-api -type f -name "*.proto*"`
|
|
|
|
sed -i 's@^import "api/@$(PACKAGE_NAME)api/@g' `find proto/chirpstack-api -type f -name "*.proto*"`
|
|
|
|
mkdir -p src
|
|
|
|
|
|
|
|
common:
|
|
|
|
$(PROTOC) $(PROTOC_ARGS) chirpstack-api/common/common.proto
|
|
|
|
|
|
|
|
gw:
|
|
|
|
$(PROTOC) $(PROTOC_ARGS) chirpstack-api/gw/gw.proto
|
|
|
|
|
|
|
|
|
|
|
|
api:
|
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/internal.proto
|
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/user.proto
|
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/tenant.proto
|
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/application.proto
|
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/device_profile.proto
|
2022-06-07 18:28:41 +00:00
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/device_profile_template.proto
|
2022-04-06 20:18:32 +00:00
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/device.proto
|
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/gateway.proto
|
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/multicast_group.proto
|
2023-05-22 10:04:13 +00:00
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/relay.proto
|
2022-04-06 20:18:32 +00:00
|
|
|
|
|
|
|
integration:
|
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/integration/integration.proto
|
|
|
|
|
2023-10-31 14:03:31 +00:00
|
|
|
stream:
|
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/stream/meta.proto
|
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/stream/frame.proto
|
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/stream/api_request.proto
|
2023-11-02 08:36:57 +00:00
|
|
|
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/stream/backend_interfaces.proto
|