Skip to content

Commit

Permalink
tools/Config:Fix some error call DELFILE/DELDIR/CATFILE/CLEAN in Wind…
Browse files Browse the repository at this point in the history
…ows native build

tools/Config:Fix some error call DELFILE/DELDIR/CATFILE  in Windows native build
  • Loading branch information
zouboan authored and xiaoxiang781216 committed Nov 30, 2022
1 parent fd9838f commit e2c2cc1
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions tools/Config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e2c2cc1

Please sign in to comment.