mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
apps/rust: Add dependencies for Rust cargo in make builds
Add a Rust make helper that collects crate input files, and use it for the Rust hello and slint examples. This makes the generated Rust static libraries depend on the crate sources, manifests, build scripts. Hook the libraries into both context and all, so re-running make after editing Rust inputs rebuilds the crate. Signed-off-by: Shoji Tokunaga <toku@mac.com>
This commit is contained in:
parent
c106a02b58
commit
840c2f30db
3 changed files with 31 additions and 2 deletions
|
|
@ -144,3 +144,18 @@ $(2)/$(1)/target/$(strip $(if $(findstring .json,$(call RUST_TARGET_TRIPLE)), \
|
|||
$(basename $(notdir $(call RUST_TARGET_TRIPLE))), \
|
||||
$(call RUST_TARGET_TRIPLE)))/$(if $(CONFIG_DEBUG_FULLOPT),release,debug)/lib$(1).a
|
||||
endef
|
||||
|
||||
# Collect crate input files for a crate
|
||||
#
|
||||
# Usage: $(call RUST_CARGO_SRCS,cratename,prefix)
|
||||
#
|
||||
# Inputs:
|
||||
# cratename - Name of the Rust crate (e.g. hello)
|
||||
# prefix - Path prefix to the crate (e.g. path/to/project)
|
||||
#
|
||||
# Output:
|
||||
# List of crate input files (excluding the cargo target directory)
|
||||
|
||||
define RUST_CARGO_SRCS
|
||||
$(shell find $(2)/$(1) -type f -not -path '$(2)/$(1)/target/*' 2>/dev/null)
|
||||
endef
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue