From 9ea121518b19c5bb4aedbe993668dedd5b07539a Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Tue, 14 Jan 2025 22:53:02 +0800 Subject: [PATCH] examples/rust: Rename hello_rust to rust/baremetal Summary: - Renamed hello_rust example to rust/baremetal to better reflect its purpose - Updated file headers and Makefile paths - Maintained all existing Kconfig options and functionality - Prepares for future Rust development patterns where Cargo will be the mainstream approach, with baremetal demonstrating traditional build method - Creates clearer structure for Rust examples as we expand Rust support Impact: - No functional changes to the example itself - Better organization of Rust examples under examples/rust/ - Existing configurations using this example will continue to work - Build system will now look for the example in the new location Testing: - Confirmed Kconfig options remain unchanged - GitHub CI passed and local build tested Signed-off-by: Huang Qi --- examples/{hello_rust => rust/baremetal}/Kconfig | 3 ++- examples/{hello_rust => rust/baremetal}/Make.defs | 4 ++-- examples/{hello_rust => rust/baremetal}/Makefile | 2 +- examples/{hello_rust => rust/baremetal}/hello_rust_main.rs | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) rename examples/{hello_rust => rust/baremetal}/Kconfig (84%) rename examples/{hello_rust => rust/baremetal}/Make.defs (91%) rename examples/{hello_rust => rust/baremetal}/Makefile (97%) rename examples/{hello_rust => rust/baremetal}/hello_rust_main.rs (98%) diff --git a/examples/hello_rust/Kconfig b/examples/rust/baremetal/Kconfig similarity index 84% rename from examples/hello_rust/Kconfig rename to examples/rust/baremetal/Kconfig index 92e3b1f34d7..a1b391beee6 100644 --- a/examples/hello_rust/Kconfig +++ b/examples/rust/baremetal/Kconfig @@ -7,7 +7,8 @@ config EXAMPLES_HELLO_RUST tristate "\"Hello, Rust!\" example" default n ---help--- - Enable the \"Hello, Rust!\" example + Enable the \"Hello, Rust!\" example to show how to build + and run a baremetal Rust application with rustc. if EXAMPLES_HELLO_RUST diff --git a/examples/hello_rust/Make.defs b/examples/rust/baremetal/Make.defs similarity index 91% rename from examples/hello_rust/Make.defs rename to examples/rust/baremetal/Make.defs index 7cb3099d206..9ea1b9f9f9e 100644 --- a/examples/hello_rust/Make.defs +++ b/examples/rust/baremetal/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/examples/hello_rust/Make.defs +# apps/examples/rust/baremetal/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_EXAMPLES_HELLO_RUST),) -CONFIGURED_APPS += $(APPDIR)/examples/hello_rust +CONFIGURED_APPS += $(APPDIR)/examples/rust/baremetal endif diff --git a/examples/hello_rust/Makefile b/examples/rust/baremetal/Makefile similarity index 97% rename from examples/hello_rust/Makefile rename to examples/rust/baremetal/Makefile index b1ac1824ca7..55e98ce7b81 100644 --- a/examples/hello_rust/Makefile +++ b/examples/rust/baremetal/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/examples/hello_rust/Makefile +# apps/examples/rust/baremetal/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/examples/hello_rust/hello_rust_main.rs b/examples/rust/baremetal/hello_rust_main.rs similarity index 98% rename from examples/hello_rust/hello_rust_main.rs rename to examples/rust/baremetal/hello_rust_main.rs index fa24671cd7f..3d7a3eceba1 100644 --- a/examples/hello_rust/hello_rust_main.rs +++ b/examples/rust/baremetal/hello_rust_main.rs @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/examples/hello_rust/hello_rust_main.rs + * apps/examples/rust/baremetal/hello_rust_main.rs * * SPDX-License-Identifier: Apache-2.0 *