diff --git a/Makefile b/Makefile index 6a3c8034d..03309d685 100644 --- a/Makefile +++ b/Makefile @@ -363,13 +363,16 @@ ifneq ($(RUST),0) include cln-rpc/Makefile include cln-grpc/Makefile +$(MSGGEN_GENALL)&: doc/schemas/*.request.json doc/schemas/*.schema.json + PYTHONPATH=contrib/msggen python3 contrib/msggen/msggen/__main__.py + GRPC_GEN = contrib/pyln-testing/pyln/testing/node_pb2.py \ contrib/pyln-testing/pyln/testing/node_pb2_grpc.py \ contrib/pyln-testing/pyln/testing/primitives_pb2.py ALL_TEST_GEN += $(GRPC_GEN) -$(GRPC_GEN): cln-grpc/proto/node.proto cln-grpc/proto/primitives.proto +$(GRPC_GEN)&: cln-grpc/proto/node.proto cln-grpc/proto/primitives.proto python -m grpc_tools.protoc -I cln-grpc/proto cln-grpc/proto/node.proto --python_out=contrib/pyln-testing/pyln/testing/ --grpc_python_out=contrib/pyln-testing/pyln/testing/ --experimental_allow_proto3_optional python -m grpc_tools.protoc -I cln-grpc/proto cln-grpc/proto/primitives.proto --python_out=contrib/pyln-testing/pyln/testing/ --experimental_allow_proto3_optional # The compiler assumes that the proto files are in the same diff --git a/cln-grpc/Makefile b/cln-grpc/Makefile index 993286be7..9307fba12 100644 --- a/cln-grpc/Makefile +++ b/cln-grpc/Makefile @@ -8,7 +8,6 @@ CLN_GRPC_GENALL = cln-grpc/proto/node.proto \ DEFAULT_TARGETS += $(CLN_GRPC_EXAMPLES) $(CLN_GRPC_GENALL) -$(CLN_GRPC_GENALL): $(JSON_SCHEMA) - PYTHONPATH=contrib/msggen python3 contrib/msggen/msggen/__main__.py +MSGGEN_GENALL += $(CLN_GRPC_GENALL) cln-grpc-all: ${CLN_GRPC_GENALL} ${CLN_GRPC_EXAMPLES} diff --git a/cln-rpc/Makefile b/cln-rpc/Makefile index eff4fdbd4..3582eeb79 100644 --- a/cln-rpc/Makefile +++ b/cln-rpc/Makefile @@ -4,11 +4,9 @@ cln-rpc-wrongdir: CLN_RPC_EXAMPLES := target/${RUST_PROFILE}/examples/cln-rpc-getinfo CLN_RPC_GENALL = cln-rpc/src/model.rs CLN_RPC_SOURCES = $(shell find cln-rpc -name *.rs) ${CLN_RPC_GENALL} -JSON_SCHEMAS = $(wildcard doc/schemas/*.request.json doc/schemas/*.schema.json) DEFAULT_TARGETS += $(CLN_RPC_EXAMPLES) $(CLN_RPC_GENALL) -$(CLN_RPC_GENALL): $(JSON_SCHEMAS) - PYTHONPATH=contrib/msggen python3 contrib/msggen/msggen/__main__.py +MSGGEN_GENALL += $(CLN_RPC_GENALL) target/${RUST_PROFILE}/examples/cln-rpc-getinfo: $(shell find cln-rpc -name *.rs) cargo build ${CARGO_OPTS} --example cln-rpc-getinfo