From e2c2cc16ee7709e0b6a6c7f89a85136d6bbaf58b Mon Sep 17 00:00:00 2001 From: zouboan Date: Thu, 10 Nov 2022 20:57:02 +0800 Subject: [PATCH] tools/Config:Fix some error call DELFILE/DELDIR/CATFILE/CLEAN in Windows native build tools/Config:Fix some error call DELFILE/DELDIR/CATFILE in Windows native build --- tools/Config.mk | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tools/Config.mk b/tools/Config.mk index 2a2438c48b..e67632f17b 100644 --- a/tools/Config.mk +++ b/tools/Config.mk @@ -450,8 +450,12 @@ endef # DELFILE - Delete one file ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define NEWLINE + + +endef define DELFILE - $(Q) if exist $1 (del /f /q $1) + $(foreach FILE, $(1), $(NEWLINE) $(Q) if exist $(FILE) (del /f /q $(FILE))) endef else define DELFILE @@ -463,7 +467,7 @@ endif ifeq ($(CONFIG_WINDOWS_NATIVE),y) define DELDIR - $(Q) if exist $1 (rmdir /q /s $1) + $(Q) if exist $1 (rmdir /q /s $1) $(NEWLINE) endef else define DELDIR @@ -501,7 +505,7 @@ endif ifeq ($(CONFIG_WINDOWS_NATIVE),y) define CATFILE - $(Q) type $(2) > $1 + $(foreach FILE, $(2), $(NEWLINE) $(Q) type $(FILE) >> $1) endef else define CATFILE @@ -529,20 +533,14 @@ ifeq ($(CONFIG_ARCH_COVERAGE),y) endif ifeq ($(CONFIG_WINDOWS_NATIVE),y) - -define NEWLINE - - -endef - define CLEAN $(Q) if exist *$(OBJEXT) (del /f /q *$(OBJEXT)) $(Q) if exist *$(LIBEXT) (del /f /q *$(LIBEXT)) $(Q) if exist *~ (del /f /q *~) $(Q) if exist (del /f /q .*.swp) - $(foreach OBJ, $(OBJS), $(NEWLINE) $(call DELFILE,$(OBJ))) - $(Q) if exist $(BIN) (del /f /q $(BIN)) - $(Q) if exist $(EXTRA) (del /f /q $(EXTRA)) + $(call DELFILE,$(subst /,\,$(OBJS))) + $(Q) if exist $(BIN) (del /f /q $(subst /,\,$(BIN))) + $(Q) if exist $(EXTRA) (del /f /q $(subst /,\,$(EXTRA))) endef else define CLEAN