build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig

so the correct value can be determinated by Kconfig system automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2020-05-19 00:08:15 +08:00 committed by patacongo
parent 0a6f978771
commit d232823e63
17 changed files with 22 additions and 27 deletions

View File

@ -128,7 +128,7 @@ $(CXXOBJS): %$(SUFFIX)$(OBJEXT): %$(CXXEXT)
$(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@)) $(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@))
.built: $(OBJS) .built: $(OBJS)
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
$(call ARLOCK, "${shell cygpath -w $(BIN)}", $(OBJS)) $(call ARLOCK, "${shell cygpath -w $(BIN)}", $(OBJS))
else else
$(call ARLOCK, $(BIN), $(OBJS)) $(call ARLOCK, $(BIN), $(OBJS))
@ -153,7 +153,7 @@ PROGOBJ := $(MAINOBJ)
$(PROGLIST): $(MAINOBJ) $(PROGLIST): $(MAINOBJ)
$(Q) mkdir -p $(BINDIR) $(Q) mkdir -p $(BINDIR)
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
$(call ELFLD,$(firstword $(PROGOBJ)),"${shell cygpath -w $(firstword $(PROGLIST))}") $(call ELFLD,$(firstword $(PROGOBJ)),"${shell cygpath -w $(firstword $(PROGLIST))}")
else else
$(call ELFLD,$(firstword $(PROGOBJ)),$(firstword $(PROGLIST))) $(call ELFLD,$(firstword $(PROGOBJ)),$(firstword $(PROGLIST)))

View File

@ -116,7 +116,7 @@ else ifeq ($(CONFIG_WINDOWS_MSYS),y)
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
else else
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh
else else
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh
@ -146,7 +146,7 @@ else
MKKCONFIG = $(APPDIR)$(DELIM)tools$(DELIM)mkkconfig.sh MKKCONFIG = $(APPDIR)$(DELIM)tools$(DELIM)mkkconfig.sh
endif endif
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
INCDIROPT = -w INCDIROPT = -w
endif endif
@ -155,7 +155,7 @@ endif
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"}
CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"}
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
LDLIBS ?= "${shell cygpath -w $(BIN)}" LDLIBS ?= "${shell cygpath -w $(BIN)}"
else else
LDLIBS ?= $(BIN) LDLIBS ?= $(BIN)

View File

@ -101,7 +101,7 @@ $(SYMTABOBJ): %$(OBJEXT): %.c
$(call COMPILE, -fno-lto $<, $@) $(call COMPILE, -fno-lto $<, $@)
$(BIN): $(SYMTABOBJ) $(BIN): $(SYMTABOBJ)
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
$(call ARLOCK, "${shell cygpath -w $(BIN)}", $^) $(call ARLOCK, "${shell cygpath -w $(BIN)}", $^)
else else
$(call ARLOCK, $(BIN), $^) $(call ARLOCK, $(BIN), $^)

View File

@ -54,12 +54,7 @@ AUDIODIR = $(SDKDIR)$(DELIM)modules$(DELIM)audio
# Audio Example flags # Audio Example flags
ifeq ($(WINTOOL),y) CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(AUDIODIR)"}
CXXFLAGS += -I "${shell cygpath -w $(AUDIODIR)}"
else
CXXFLAGS += -I $(AUDIODIR)
endif
CXXFLAGS += -D_POSIX CXXFLAGS += -D_POSIX
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -38,7 +38,7 @@
OBJEXT ?= .o OBJEXT ?= .o
DELIM ?= / DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
else else
NUTTXLIB = "$(TOPDIR)$(DELIM)staging" NUTTXLIB = "$(TOPDIR)$(DELIM)staging"

View File

@ -38,7 +38,7 @@
OBJEXT ?= .o OBJEXT ?= .o
DELIM ?= / DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
else else
NUTTXLIB = "$(TOPDIR)$(DELIM)staging" NUTTXLIB = "$(TOPDIR)$(DELIM)staging"

View File

@ -38,7 +38,7 @@
OBJEXT ?= .o OBJEXT ?= .o
DELIM ?= / DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
else else
NUTTXLIB = "$(TOPDIR)$(DELIM)staging" NUTTXLIB = "$(TOPDIR)$(DELIM)staging"

View File

@ -38,7 +38,7 @@
OBJEXT ?= .o OBJEXT ?= .o
DELIM ?= / DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
else else
NUTTXLIB = "$(TOPDIR)$(DELIM)staging" NUTTXLIB = "$(TOPDIR)$(DELIM)staging"

View File

@ -38,7 +38,7 @@
OBJEXT ?= .o OBJEXT ?= .o
DELIM ?= / DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
else else
NUTTXLIB = "$(TOPDIR)$(DELIM)staging" NUTTXLIB = "$(TOPDIR)$(DELIM)staging"

View File

@ -38,7 +38,7 @@
OBJEXT ?= .o OBJEXT ?= .o
DELIM ?= / DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
else else
NUTTXLIB = "$(TOPDIR)$(DELIM)staging" NUTTXLIB = "$(TOPDIR)$(DELIM)staging"

View File

@ -38,7 +38,7 @@
OBJEXT ?= .o OBJEXT ?= .o
DELIM ?= / DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
else else
NUTTXLIB = "$(TOPDIR)$(DELIM)staging" NUTTXLIB = "$(TOPDIR)$(DELIM)staging"

View File

@ -40,7 +40,7 @@ DELIM ?= /
CELFFLAGS += -I. CELFFLAGS += -I.
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
else else
NUTTXLIB = "$(TOPDIR)$(DELIM)staging" NUTTXLIB = "$(TOPDIR)$(DELIM)staging"

View File

@ -38,7 +38,7 @@
OBJEXT ?= .o OBJEXT ?= .o
DELIM ?= / DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
else else
NUTTXLIB = "$(TOPDIR)$(DELIM)staging" NUTTXLIB = "$(TOPDIR)$(DELIM)staging"

View File

@ -38,7 +38,7 @@
OBJEXT ?= .o OBJEXT ?= .o
DELIM ?= / DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
else else
NUTTXLIB = "$(TOPDIR)$(DELIM)staging" NUTTXLIB = "$(TOPDIR)$(DELIM)staging"

View File

@ -38,7 +38,7 @@
OBJEXT ?= .o OBJEXT ?= .o
DELIM ?= / DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
else else
NUTTXLIB = "$(TOPDIR)$(DELIM)staging" NUTTXLIB = "$(TOPDIR)$(DELIM)staging"

View File

@ -38,7 +38,7 @@
OBJEXT ?= .o OBJEXT ?= .o
DELIM ?= / DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
else else
NUTTXLIB = "$(TOPDIR)$(DELIM)staging" NUTTXLIB = "$(TOPDIR)$(DELIM)staging"

View File

@ -148,7 +148,7 @@ endif
# Tool related definitions # Tool related definitions
# Compiler # Compiler
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
# Windows-native toolchains # Windows-native toolchains
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)$(DELIM)include}" ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)$(DELIM)include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)$(DELIM)include}" -isystem "${shell cygpath -w $(TOPDIR)$(DELIM)include$(DELIM)cxx}" ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)$(DELIM)include}" -isystem "${shell cygpath -w $(TOPDIR)$(DELIM)include$(DELIM)cxx}"
@ -181,7 +181,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__
# Linker # Linker
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
# Windows-native toolchains # Windows-native toolchains
LDLIBPATH = -L "${shell cygpath -w $(APPDIR)}" -L "${shell cygpath -w $(TOPDIR)$(DELIM)libs}" LDLIBPATH = -L "${shell cygpath -w $(APPDIR)}" -L "${shell cygpath -w $(TOPDIR)$(DELIM)libs}"
else else
@ -203,7 +203,7 @@ endif
# ELF module definitions # ELF module definitions
LDELFFLAGS = -r -e _start -Bstatic LDELFFLAGS = -r -e _start -Bstatic
ifeq ($(WINTOOL),y) ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
LDELFFLAGS += -T "${shell cygpath -w $(TOPDIR)/scripts/gnu-elf.ld}" LDELFFLAGS += -T "${shell cygpath -w $(TOPDIR)/scripts/gnu-elf.ld}"
else else
LDELFFLAGS += -T $(TOPDIR)/scripts/gnu-elf.ld LDELFFLAGS += -T $(TOPDIR)/scripts/gnu-elf.ld