Skip to content

Conversation

@tejlmand
Copy link
Contributor

@tejlmand tejlmand commented Feb 9, 2021

Fixes: #23449

This commit adds additional OUTPUT and BYPRODUCTS to custom command
and targets in the Zephyr build system.

This ensures that files produced during the build will be removed again
when invoking ninja clean / make clean.

The generated syscalls headers include folder is added to the syscall
target using ADDITIONAL_CLEAN_FILES property.
However, this property is new in CMake 3.15, so will not work when using
older CMake with ninja.

For CMake versions <=3.15 the ADDITIONAL_MAKE_CLEAN_FILES property is
used. However, this only supports Makefile generator.

Signed-off-by: Torsten Rasmussen [email protected]

Fixes: zephyrproject-rtos#23449

This commit adds additional OUTPUT and BYPRODUCTS to custom command
and targets in the Zephyr build system.

This ensures that files produced during the build will be removed again
when invoking ninja clean / make clean.

The generated syscalls headers include folder is added to the syscall
target using ADDITIONAL_CLEAN_FILES property.
However, this property is new in CMake 3.15, so will not work when using
older CMake with ninja.

For CMake versions <=3.15 the ADDITIONAL_MAKE_CLEAN_FILES property is
used. However, this only supports Makefile generator.

Signed-off-by: Torsten Rasmussen <[email protected]>
@tejlmand
Copy link
Contributor Author

tejlmand commented Feb 9, 2021

Note: This is first round of cleaning up mentioned here: #23449
This fix ensures all build output files from Hello World on an Arm based board is correctly cleaned up, which should then cover most samples and board.

There could be missing output / byproducts in other parts of build system that haven't been discovered yet, but those must be handled as they are discovered.

@tejlmand tejlmand added the bug The issue is a bug, or the PR is fixing a bug label Feb 10, 2021
@tejlmand tejlmand added this to the v2.5.0 milestone Feb 10, 2021
@carlescufi
Copy link
Member

@nashif it would be good to include this in 2.5, fixes a low-prio bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Build System bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"make clean" doesn't clean a lot of generated files

3 participants