From adbff7de81944ef76fbdb9838fe5d7b29641a6b2 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 13 May 2018 17:22:25 +0800 Subject: [PATCH] tools/Config.mk: add DEFINE macro like INCDIR --- libs/libc/Makefile | 6 +----- libs/libnx/Makefile | 6 +----- mm/Makefile | 6 +----- tools/Config.mk | 2 ++ tools/Makefile.unix | 2 +- tools/Makefile.win | 2 +- 6 files changed, 7 insertions(+), 17 deletions(-) diff --git a/libs/libc/Makefile b/libs/libc/Makefile index f4b6cea387..de648dc375 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 c0109dc07d..cdf9b4fa14 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 bc4ce9aff4..7f1dbcfb6a 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 2a45f5b0e6..0f6212890d 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 917ea0dbdf..cb4c0cc4c1 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 6ef5bdc65f..be4fd82a60 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