diff --git a/libs/libc/Makefile b/libs/libc/Makefile index f4b6cea3873..de648dc3751 100644 --- a/libs/libc/Makefile +++ b/libs/libc/Makefile @@ -38,11 +38,7 @@ # CFLAGS ifneq ($(CONFIG_BUILD_FLAT),y) -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - KDEFINE = ${shell $(TOPDIR)\tools\define.bat "$(CC)" __KERNEL__} -else - KDEFINE = ${shell $(TOPDIR)/tools/define.sh "$(CC)" __KERNEL__} -endif + KDEFINE = ${shell $(DEFINE) "$(CC)" __KERNEL__} endif # Sources and paths diff --git a/libs/libnx/Makefile b/libs/libnx/Makefile index c0109dc07d5..cdf9b4fa148 100644 --- a/libs/libnx/Makefile +++ b/libs/libnx/Makefile @@ -38,11 +38,7 @@ # CFLAGS ifneq ($(CONFIG_BUILD_FLAT),y) -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - KDEFINE = ${shell $(TOPDIR)\tools\define.bat "$(CC)" __KERNEL__} -else - KDEFINE = ${shell $(TOPDIR)/tools/define.sh "$(CC)" __KERNEL__} -endif + KDEFINE = ${shell $(DEFINE) "$(CC)" __KERNEL__} endif # Sources and paths diff --git a/mm/Makefile b/mm/Makefile index bc4ce9aff4c..7f1dbcfb6a8 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -41,11 +41,7 @@ DELIM := $(strip /) # CFLAGS ifneq ($(CONFIG_BUILD_FLAT),y) -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - KDEFINE = ${shell $(TOPDIR)\tools\define.bat "$(CC)" __KERNEL__} -else - KDEFINE = ${shell $(TOPDIR)/tools/define.sh "$(CC)" __KERNEL__} -endif + KDEFINE = ${shell $(DEFINE) "$(CC)" __KERNEL__} endif # Sources and paths diff --git a/tools/Config.mk b/tools/Config.mk index 2a45f5b0e6b..0f6212890df 100644 --- a/tools/Config.mk +++ b/tools/Config.mk @@ -93,8 +93,10 @@ endif # CONFIG_WINDOWS_NATIVE - Defined for a Windows native build ifeq ($(CONFIG_WINDOWS_NATIVE),y) + DEFINE = "$(TOPDIR)\tools\define.bat" INCDIR = "$(TOPDIR)\tools\incdir.bat" else + DEFINE = "$(TOPDIR)/tools/define.sh" INCDIR = "$(TOPDIR)/tools/incdir.sh" endif diff --git a/tools/Makefile.unix b/tools/Makefile.unix index 917ea0dbdf8..cb4c0cc4c15 100644 --- a/tools/Makefile.unix +++ b/tools/Makefile.unix @@ -81,7 +81,7 @@ endif # This define is passed as EXTRADEFINES for kernel-mode builds. It is also passed # during PASS1 (but not PASS2) context and depend targets. -KDEFINE = ${shell $(TOPDIR)/tools/define.sh "$(CC)" __KERNEL__} +KDEFINE = ${shell $(DEFINE) "$(CC)" __KERNEL__} # Process architecture and board-specific directories diff --git a/tools/Makefile.win b/tools/Makefile.win index 6ef5bdc65f2..be4fd82a60c 100644 --- a/tools/Makefile.win +++ b/tools/Makefile.win @@ -66,7 +66,7 @@ endif # This define is passed as EXTRADEFINES for kernel-mode builds. It is also passed # during PASS1 (but not PASS2) context and depend targets. -KDEFINE = ${shell $(TOPDIR)\tools\define.bat "$(CC)" __KERNEL__} +KDEFINE = ${shell $(DEFINE) "$(CC)" __KERNEL__} # Process architecture and board-specific directories