mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
8d737cc4bf
See the section headed "Rules with Grouped Targets" on the Texinfo page `(make)Multiple Targets`. Without this fix, Make does not know that these recipes unconditionally make *all* of their named targets regardless of which target triggers their execution, and Make will blissfully execute multiple instances of any such recipe in parallel, not only wasting CPU cycles but potentially producing incorrect results if the recipe is not atomic in its effects on the file system. With this fix, Make understands that it need only execute such a recipe once to make all of its targets. In pursuit of the above, move and combine two redundant msggen recipes into the top-level Makefile, and populate its grouped targets from the subordinate Makefiles. Changelog-None
22 lines
801 B
Makefile
22 lines
801 B
Makefile
cln-rpc-wrongdir:
|
|
$(MAKE) -C .. cln-rpc-all
|
|
|
|
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}
|
|
DEFAULT_TARGETS += $(CLN_RPC_EXAMPLES) $(CLN_RPC_GENALL)
|
|
|
|
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
|
|
|
|
target/${RUST_PROFILE}/examples/cln-plugin-startup: $(shell find cln-rpc -name *.rs)
|
|
cargo build ${CARGO_OPTS} --example cln-plugin-startup
|
|
|
|
target/${RUST_PROFILE}/examples/cln-plugin-reentrant: $(shell find plugins/examples -name *.rs)
|
|
cargo build ${CARGO_OPTS} --example cln-plugin-reentrant
|
|
|
|
|
|
cln-rpc-all: ${CLN_RPC_GEN_ALL} ${CLN_RPC_EXAMPLES}
|