zephyr/cmake/usage/usage.cmake
Benjamin Cabé 159ab1c09f cmake: flash: remove deprecated flash/debug/attach/rtt targets
The CMake build system targets `flash`, `debug`, `debugserver`, `attach`
and `rtt` were deprecated in Zephyr 4.3 and are removed here as part of
the 4.5 deprecation removal cycle. They were thin wrappers that shelled
out to the corresponding west command, so users must now call `west
flash`, `west debug`, `west debugserver`, `west attach` and `west rtt`
directly. Note that `west build -t <target>` and `ninja <target>` are the
same mechanism, so both spellings are affected.

The generator loop was the only consumer of the `WEST_DIR` lookup and of
cmake/flash/check_runner_dependencies.cmake, so both are removed as well.
The runners.yaml generation in cmake/flash/CMakeLists.txt is kept: it is
what the west commands read, and it is also included directly by the
Nordic UICR helper projects.

The `run`, `run_<emulator>` and emulation `debugserver` targets are
provided by cmake/emu and are not affected.

Documentation that told users to run `ninja flash`, `ninja debug` or
`ninja attach` is updated to the equivalent west command, and the
zephyr-app-commands directive now rejects the removed goals when the
cmake tool is selected, so the docs cannot regress.

The now-unused RUNNERS_DEPS variable and the
check_runner_dependencies.cmake helper, which only existed to serve those
targets, are removed as well.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
2026-08-27 21:23:56 +01:00

49 lines
2.6 KiB
CMake

# SPDX-License-Identifier: Apache-2.0
if(NOT DEFINED ZEPHYR_BASE)
message(FATAL_ERROR "ZEPHYR_BASE not set")
endif()
get_filename_component(generator ${CMAKE_MAKE_PROGRAM} NAME)
if(${generator} STREQUAL ninja)
set(verbose "-v")
else()
set(verbose "VERBOSE=1")
endif()
message("Cleaning targets:")
message(" clean - Remove most generated files but keep configuration and backup files")
message(" pristine - Remove all files in the build directory")
message("")
message("Kconfig targets:")
message(" menuconfig - Update .config using a console-based interface")
message(" guiconfig - Update .config using a graphical interface")
message("")
message("Other generic targets:")
message(" all - Build a zephyr application")
message(" run - Build a zephyr application and run it if the board supports emulation")
message(" debugserver - Start a GDB server if the board supports emulation (port 1234 for QEMU targets)")
message(" pahole - Report struct padding (requires the pahole program)")
message(" puncover - Local web server to view RAM, ROM and stack usage (requires puncover pip module)")
message(" ram_report - Build and create RAM usage report")
message(" rom_report - Build and create ROM usage report")
message(" ram_plot - Build and create RAM usage in a sunburst chart as a visual representation")
message(" rom_plot - Build and create ROM usage in a sunburst chart as a visual representation")
message(" traceconfig - Generate a file in the build directory that details how each symbol got its final value")
message(" footprint - Create JSON RAM/ROM usage report in the build directory")
message(" dashboard - Generate an HTML dashboard with footprint, traceconfig, initlevels, devicetree, and other details")
message(" initlevels - Display the initialization sequence")
message(" boards - Display supported boards")
message(" shields - Display supported shields")
message(" snippets - Display supported snippets")
message(" usage - Display this text")
message(" llext-edk - Build the Linkable Loadable Extension (LLEXT) Extension Development Kit (EDK)")
message(" help - Display all build system targets")
message("")
message("Build flags:")
message("")
message(" ${generator} ${verbose} [targets] verbose build")
message(" cmake -DW=n Enable extra gcc checks, n=1,2,3 where")
message(" 1: warnings which may be relevant and do not occur too often")
message(" 2: warnings which occur quite often but may still be relevant")
message(" 3: more obscure warnings, can most likely be ignored")
message(" Multiple levels can be combined with W=12 or W=123")