diff options
| author | Peter0x44 <[email protected]> | 2022-02-12 16:59:48 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-12 17:59:48 +0100 |
| commit | dd15531e25b73f1b3d37196effd5ac7685d8026e (patch) | |
| tree | 43d5700a2c65c0d95fa6541e806046db5f544c0c /src | |
| parent | ddba8478c53f32e00b89432b960d2c69392e4360 (diff) | |
| download | raylib-dd15531e25b73f1b3d37196effd5ac7685d8026e.tar.gz raylib-dd15531e25b73f1b3d37196effd5ac7685d8026e.zip | |
Properly fix make clean under windows (#2341)
* Properly fix make clean under sh.exe
* Ensure make clean works properly under Windows if RAYLIB_RELEASE_PATH is modified
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/Makefile b/src/Makefile index 3048f98a..f543b0b5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -728,24 +728,24 @@ else @echo "Error: Root permissions needed for uninstallation. Try sudo make uninstall" endif +.PHONY: clean_LINUX clean_WINDOWS clean_ANDROID clean_BSD clean_OSX + # 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 - del lib$(RAYLIB_LIB_NAME)dll.a /s - del $(RAYLIB_LIB_NAME).dll /s -else +clean: clean_$(PLATFORM_OS) + @echo "removed all generated files!" + +clean_LINUX clean_BSD clean_OSX: + 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* + +clean_ANDROID: 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!" + +clean_WINDOWS: SHELL := cmd.exe + +clean_WINDOWS: + del *.o /s + cd $(RAYLIB_RELEASE_PATH) & \ + del lib$(RAYLIB_LIB_NAME).a /s & \ + del lib$(RAYLIB_LIB_NAME)dll.a /s & \ + del $(RAYLIB_LIB_NAME).dll /s |
