[PATCH v2 3/5] Makefile: clean '.c' files generated by carray

Ivan Orlov ivan.orlov0322 at gmail.com
Thu Feb 15 08:16:23 PST 2024


`make clean` doesn't clear the '*.c' files generated by carray.sh
in the 'build' directory. Fix it by extending the 'clean' makefile
target.

This is the only way we are able to regenerate the carray .c file in
case if we add a new test to the 'carray-sbi_unit_tests-y' Makefile
variable. However, running `make clear` every time we add a new test
is not really convenient, so the mechanics should be changed in the
future.

Signed-off-by: Ivan Orlov <ivan.orlov0322 at gmail.com>
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index 680c19a..4519277 100644
--- a/Makefile
+++ b/Makefile
@@ -684,6 +684,8 @@ clean:
 	$(CMD_PREFIX)find $(build_dir) -type f -name "*.bin" -exec rm -rf {} +
 	$(if $(V), @echo " RM        $(build_dir)/*.dtb")
 	$(CMD_PREFIX)find $(build_dir) -type f -name "*.dtb" -exec rm -rf {} +
+	$(if $(V), @echo " RM        $(build_dir)/*.c")
+	$(CMD_PREFIX)find $(build_dir) -type f -name "*.c" -exec rm -rf {} +
 
 # Rule for "make distclean"
 .PHONY: distclean
-- 
2.34.1




More information about the opensbi mailing list