From a2f657e4cb1d0aa895dfc5bac134a74a384e610e Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 2 May 2020 04:29:47 +0800 Subject: [PATCH] build: Move KDEFINE to a common place(tools/Config.mk) Signed-off-by: Xiang Xiao --- libs/libc/Makefile | 6 ------ libs/libnx/Makefile | 6 ------ mm/Makefile | 6 ------ tools/Config.mk | 5 +++++ tools/Makefile.unix | 5 ----- tools/Makefile.win | 5 ----- 6 files changed, 5 insertions(+), 28 deletions(-) diff --git a/libs/libc/Makefile b/libs/libc/Makefile index 2068f663b7..56a677b97d 100644 --- a/libs/libc/Makefile +++ b/libs/libc/Makefile @@ -35,12 +35,6 @@ -include $(TOPDIR)/Make.defs -# CFLAGS - -ifneq ($(CONFIG_BUILD_FLAT),y) - KDEFINE = ${shell $(DEFINE) "$(CC)" __KERNEL__} -endif - # Sources and paths ASRCS = diff --git a/libs/libnx/Makefile b/libs/libnx/Makefile index ac7268fc8a..d9948fa295 100644 --- a/libs/libnx/Makefile +++ b/libs/libnx/Makefile @@ -35,12 +35,6 @@ -include $(TOPDIR)/Make.defs -# CFLAGS - -ifneq ($(CONFIG_BUILD_FLAT),y) - KDEFINE = ${shell $(DEFINE) "$(CC)" __KERNEL__} -endif - # Sources and paths ASRCS = diff --git a/mm/Makefile b/mm/Makefile index 32fd3f4ca4..e5865b00db 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -38,12 +38,6 @@ # REVISIT: Backslash causes problems in $(COBJS) target DELIM := $(strip /) -# CFLAGS - -ifneq ($(CONFIG_BUILD_FLAT),y) - KDEFINE = ${shell $(DEFINE) "$(CC)" __KERNEL__} -endif - # Sources and paths ASRCS = diff --git a/tools/Config.mk b/tools/Config.mk index 764e2bae29..f96c40e6e3 100644 --- a/tools/Config.mk +++ b/tools/Config.mk @@ -60,6 +60,11 @@ CONFIG_ARCH_BOARD := $(patsubst "%",%,$(strip $(CONFIG_ARCH_BOARD))) OBJEXT ?= .o LIBEXT ?= .a +# This define is passed as EXTRAFLAGS for kernel-mode builds. It is also passed +# during PASS1 (but not PASS2) context and depend targets. + +KDEFINE = ${shell $(DEFINE) "$(CC)" __KERNEL__} + # DELIM - Path segment delimiter character # # Depends on this settings defined in board-specific defconfig file installed diff --git a/tools/Makefile.unix b/tools/Makefile.unix index e332a4c653..e99c4cf104 100644 --- a/tools/Makefile.unix +++ b/tools/Makefile.unix @@ -81,11 +81,6 @@ DIRLINK = $(TOPDIR)/tools/link.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh endif -# This define is passed as EXTRAFLAGS for kernel-mode builds. It is also passed -# during PASS1 (but not PASS2) context and depend targets. - -KDEFINE = ${shell $(DEFINE) "$(CC)" __KERNEL__} - # Process architecture and board-specific directories ARCH_DIR = arch/$(CONFIG_ARCH) diff --git a/tools/Makefile.win b/tools/Makefile.win index 5950f69690..8c302473bf 100644 --- a/tools/Makefile.win +++ b/tools/Makefile.win @@ -63,11 +63,6 @@ else export Q := @ endif -# This define is passed as EXTRAFLAGS for kernel-mode builds. It is also passed -# during PASS1 (but not PASS2) context and depend targets. - -KDEFINE = ${shell $(DEFINE) "$(CC)" __KERNEL__} - # Process architecture and board-specific directories ARCH_DIR = arch\$(CONFIG_ARCH)