diff --git a/library/Makefile b/library/Makefile index a2d35fea7a..6692a81f61 100644 --- a/library/Makefile +++ b/library/Makefile @@ -389,10 +389,12 @@ $(GENERATED_WRAPPER_FILES): psa_crypto.o:psa_crypto_driver_wrappers.h +RM ?= rm + clean: ifndef WINDOWS - rm -f *.o *.s libmbed* - rm -f $(THIRDPARTY_CRYPTO_OBJECTS) $(THIRDPARTY_CRYPTO_OBJECTS:.o=.s) + $(RM) -f *.o *.s libmbed* + $(RM) -f $(THIRDPARTY_CRYPTO_OBJECTS) $(THIRDPARTY_CRYPTO_OBJECTS:.o=.s) else if exist *.o del /Q /F *.o if exist *.s del /Q /F *.s @@ -402,7 +404,7 @@ endif neat: clean ifndef WINDOWS - rm -f $(GENERATED_FILES) + $(RM) -f $(GENERATED_FILES) else for %f in ($(subst /,\,$(GENERATED_FILES))) if exist %f del /Q /F %f endif diff --git a/tests/scripts/components-build-system.sh b/tests/scripts/components-build-system.sh index fb24872ecc..0ba5aafd8c 100644 --- a/tests/scripts/components-build-system.sh +++ b/tests/scripts/components-build-system.sh @@ -50,6 +50,8 @@ component_build_make_no_gen_files () { # GCC needs "as" in $PATH by default. To use GCC, we need to tell it where # to find the assembler. Or we can use clang which just works. CC="$(command -v clang)" + # For cleaning. + RM="$(command -v rm)" # Test the build with make. # Preferably we should also test with CMake. Note that a CMake test