Fix make clean target failing when shell is not cmd (#2338)

GNU make on Windows first tries to find sh.exe on the path,
and will execute build rules using it if it is present.
The make clean target uses the builtin cmd.exe command del, which
won't work under sh.exe

The reason this is not done for the entire Makefile is because it would
break cross-compilation of raylib.
This commit is contained in:
Peter0x44 2022-02-10 19:52:34 +00:00 committed by GitHub
parent 30797d3201
commit 81cced4d83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -731,6 +731,12 @@ endif
# Clean everything
clean:
ifeq ($(PLATFORM_OS),WINDOWS)
# Make always tries to run build rules under sh.exe by default
# So if sh.exe is present in the PATH on windows, the del commands will fail
# see README.W32 of GNU Make for more details
# It is not specified earlier in the Makefile, because then cross-compilation
# will also fail.
SHELL = cmd
del *.o /s
cd $(RAYLIB_RELEASE_PATH)
del lib$(RAYLIB_LIB_NAME).a /s