Fix "make clean" when using cmd.exe shell on Windows

This commit is contained in:
byuu 2020-01-16 05:40:55 +09:00
parent 1afd440c86
commit c6918fc170
1 changed files with 10 additions and 8 deletions

View File

@ -34,15 +34,17 @@ ifeq ($(platform),)
else else
$(error unknown platform, please specify manually.) $(error unknown platform, please specify manually.)
endif endif
endif
# common commands # common commands
ifeq ($(uname),) ifeq ($(shell echo ^^),^)
delete = $(info Deleting $1 ...) @del /q $(subst /,\,$1) # cmd
rdelete = $(info Deleting $1 ...) @del /s /q $(subst /,\,$1) && if exist $(subst /,\,$1) (rmdir /s /q $(subst /,\,$1)) delete = $(info Deleting $1 ...) @del /q $(subst /,\,$1)
else rdelete = $(info Deleting $1 ...) @del /s /q $(subst /,\,$1) && if exist $(subst /,\,$1) (rmdir /s /q $(subst /,\,$1))
delete = $(info Deleting $1 ...) @rm -f $1 else
rdelete = $(info Deleting $1 ...) @rm -rf $1 # sh
endif delete = $(info Deleting $1 ...) @rm -f $1
rdelete = $(info Deleting $1 ...) @rm -rf $1
endif endif
compiler.c = $(compiler) -x c -std=c11 compiler.c = $(compiler) -x c -std=c11