Properly fix make clean under sh.exe

This commit is contained in:
Peter0x44 2022-02-12 16:10:37 +00:00
parent 81cced4d83
commit d8a3782662
No known key found for this signature in database
GPG Key ID: A8DEAD1A4BB82440

View File

@ -728,24 +728,24 @@ else
@echo "Error: Root permissions needed for uninstallation. Try sudo make uninstall" @echo "Error: Root permissions needed for uninstallation. Try sudo make uninstall"
endif endif
.PHONY: clean_LINUX clean_WINDOWS clean_ANDROID clean_BSD clean_OSX
# Clean everything # Clean everything
clean: clean: clean_$(PLATFORM_OS)
ifeq ($(PLATFORM_OS),WINDOWS) @echo "removed all generated files!"
# 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 clean_LINUX clean_BSD clean_OSX:
# see README.W32 of GNU Make for more details rm -fv *.o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).a $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).bc $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).so*
# It is not specified earlier in the Makefile, because then cross-compilation
# will also fail. clean_ANDROID:
SHELL = cmd rm -fv *.o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).a $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).bc $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).so*
rm -rf $(ANDROID_TOOLCHAIN) $(NATIVE_APP_GLUE)/android_native_app_glue.o
clean_WINDOWS: SHELL := cmd.exe
clean_WINDOWS:
del *.o /s del *.o /s
cd $(RAYLIB_RELEASE_PATH) cd $(RAYLIB_RELEASE_PATH)
del lib$(RAYLIB_LIB_NAME).a /s del lib$(RAYLIB_LIB_NAME).a /s
del lib$(RAYLIB_LIB_NAME)dll.a /s del lib$(RAYLIB_LIB_NAME)dll.a /s
del $(RAYLIB_LIB_NAME).dll /s del $(RAYLIB_LIB_NAME).dll /s
else
rm -fv *.o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).a $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).bc $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).so*
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
rm -rf $(ANDROID_TOOLCHAIN) $(NATIVE_APP_GLUE)/android_native_app_glue.o
endif
@echo "removed all generated files!"