Handle deleting non-existant files on Windows

If we try to delete a non-existant file using del on Windows, as
can happen when running make clean, del will throw an error. Make
the Makefiles more robust by only deleting files if they exist.
This commit is contained in:
Darryl Green
2019-08-30 15:45:46 +01:00
committed by Jaeden Amero
parent 31465c6c1f
commit 9b9a790be6
4 changed files with 10 additions and 4 deletions
+3 -1
View File
@@ -165,5 +165,7 @@ clean:
ifndef WINDOWS
rm -f *.o libmbed* $(OBJS_CRYPTO)
else
del /Q /F *.o libmbed* $(OBJS_CRYPTO)
if exist *.o del /Q /F *.o
if exist libmbed* del /Q /F libmbed*
if exist $(OBJS_CRYPTO) del /Q /F $(OBJS_CRYPTO)
endif
+2 -1
View File
@@ -317,7 +317,8 @@ ifndef WINDOWS
-rm -f ssl/ssl_pthread_server$(EXEXT)
-rm -f test/cpp_dummy_build$(EXEXT)
else
del /S /Q /F *.o *.exe
if exist *.o del /Q /F *.o
if exist *.exe del /Q /F *.exe
endif
$(MAKE) -C fuzz clean
+2 -1
View File
@@ -69,5 +69,6 @@ clean:
ifndef WINDOWS
rm -rf $(BINARIES) *.o
else
del /Q /F *.o *.exe
if exist *.o del /Q /F *.o
if exist *.exe del /Q /F *.exe
endif
+3 -1
View File
@@ -160,7 +160,9 @@ clean:
ifndef WINDOWS
rm -rf $(BINARIES) *.c *.datax TESTS
else
del /Q /F *.c *.exe *.datax
if exist *.c del /Q /F *.c
if exist *.exe del /Q /F *.exe
if exist *.datax del /Q /F *.datax
ifneq ($(wildcard TESTS/.*),)
rmdir /Q /S TESTS
endif