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:
parent
31465c6c1f
commit
9b9a790be6
4 changed files with 10 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue