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