From 800c960d0d7cc4278aade45cab7a4082e85ac402 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 4 May 2020 07:53:00 -0400 Subject: [PATCH] build: reports: add puncover target puncover is a footprint and stack analysis tool in python, see https://github.com/HBehrens/puncover Add custom target puncover which launches puncover with the right options. Launch for example with: west build -b frdm_k64f samples/hello_world/ -t puncover Signed-off-by: Anas Nashif --- cmake/reports/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cmake/reports/CMakeLists.txt b/cmake/reports/CMakeLists.txt index 53068587c5b..53dc3382352 100644 --- a/cmake/reports/CMakeLists.txt +++ b/cmake/reports/CMakeLists.txt @@ -17,3 +17,20 @@ foreach(report ram_report rom_report) $ ) endforeach() + +find_program(PUNCOVER puncover) + +if(NOT ${PUNCOVER} STREQUAL PUNCOVER-NOTFOUND) + add_custom_target( + puncover + ${PUNCOVER} + --elf_file ${ZEPHYR_BINARY_DIR}/${KERNEL_ELF_NAME} + --gcc_tools_base ${CROSS_COMPILE} + --src_root ${ZEPHYR_BASE} + --build_dir ${CMAKE_BINARY_DIR} + DEPENDS ${logical_target_for_zephyr_elf} + $ + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + USES_TERMINAL + ) +endif()