diff --git a/subsys/shell/CMakeLists.txt b/subsys/shell/CMakeLists.txt index 442ab2b7c59..cd6e4c86e82 100644 --- a/subsys/shell/CMakeLists.txt +++ b/subsys/shell/CMakeLists.txt @@ -1,6 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 add_subdirectory(modules) +add_subdirectory(backends) zephyr_sources_ifdef( CONFIG_SHELL @@ -11,24 +12,9 @@ zephyr_sources_ifdef( ) zephyr_sources_ifdef( - CONFIG_SHELL_BACKEND_SERIAL - shell_uart.c -) - -zephyr_sources_ifdef( - CONFIG_SHELL_BACKEND_DUMMY - shell_dummy.c -) - -zephyr_sources_ifdef( - CONFIG_SHELL_BACKEND_RTT - shell_rtt.c -) - -zephyr_sources_ifdef( - CONFIG_SHELL_BACKEND_TELNET - shell_telnet.c -) + CONFIG_SHELL_LOG_BACKEND + shell_log_backend.c + ) zephyr_sources_ifdef( CONFIG_SHELL_HELP @@ -43,19 +29,14 @@ zephyr_sources_ifdef( zephyr_sources_ifdef( CONFIG_SHELL_CMDS shell_cmds.c -) + ) zephyr_sources_ifdef( CONFIG_SHELL_HISTORY shell_history.c -) - -zephyr_sources_ifdef( - CONFIG_SHELL_LOG_BACKEND - shell_log_backend.c -) + ) zephyr_sources_ifdef( CONFIG_SHELL_WILDCARD shell_wildcard.c -) + ) diff --git a/subsys/shell/Kconfig b/subsys/shell/Kconfig index 79593b5f462..30d0b0a23f2 100644 --- a/subsys/shell/Kconfig +++ b/subsys/shell/Kconfig @@ -15,7 +15,7 @@ if SHELL module = SHELL module-str = Shell source "subsys/logging/Kconfig.template.log_config" -source "subsys/shell/Kconfig.backends" +source "subsys/shell/backends/Kconfig.backends" config SHELL_MINIMAL bool "Default config to reduce flash and memory requirements" diff --git a/subsys/shell/backends/CMakeLists.txt b/subsys/shell/backends/CMakeLists.txt new file mode 100644 index 00000000000..e38d091c895 --- /dev/null +++ b/subsys/shell/backends/CMakeLists.txt @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: Apache-2.0 + +zephyr_sources_ifdef( + CONFIG_SHELL_BACKEND_SERIAL + shell_uart.c +) + +zephyr_sources_ifdef( + CONFIG_SHELL_BACKEND_DUMMY + shell_dummy.c +) + +zephyr_sources_ifdef( + CONFIG_SHELL_BACKEND_RTT + shell_rtt.c +) + +zephyr_sources_ifdef( + CONFIG_SHELL_BACKEND_TELNET + shell_telnet.c +) diff --git a/subsys/shell/Kconfig.backends b/subsys/shell/backends/Kconfig.backends similarity index 100% rename from subsys/shell/Kconfig.backends rename to subsys/shell/backends/Kconfig.backends diff --git a/subsys/shell/shell_dummy.c b/subsys/shell/backends/shell_dummy.c similarity index 100% rename from subsys/shell/shell_dummy.c rename to subsys/shell/backends/shell_dummy.c diff --git a/subsys/shell/shell_rtt.c b/subsys/shell/backends/shell_rtt.c similarity index 100% rename from subsys/shell/shell_rtt.c rename to subsys/shell/backends/shell_rtt.c diff --git a/subsys/shell/shell_telnet.c b/subsys/shell/backends/shell_telnet.c similarity index 100% rename from subsys/shell/shell_telnet.c rename to subsys/shell/backends/shell_telnet.c diff --git a/subsys/shell/shell_telnet_protocol.h b/subsys/shell/backends/shell_telnet_protocol.h similarity index 100% rename from subsys/shell/shell_telnet_protocol.h rename to subsys/shell/backends/shell_telnet_protocol.h diff --git a/subsys/shell/shell_uart.c b/subsys/shell/backends/shell_uart.c similarity index 100% rename from subsys/shell/shell_uart.c rename to subsys/shell/backends/shell_uart.c