summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-02-14 13:56:26 -0500
committerTom Rini <trini@konsulko.com>2020-02-14 14:04:15 -0500
commit40592c438f714e72a1cd4cf92a5ffdf93c3f00b8 (patch)
tree9de65655ffde7453d86e3f0e7e69ab7b8bc8f39c
parentf2a73d6867ef973fbb8471cc87058205999b5e5c (diff)
downloadu-boot-WIP/kbuild-resync-v4.2.tar.gz
kbuild: sync with Linux 4.2WIP/kbuild-resync-v4.2
Update some build scripts to match Linux 4.2. Commit-based syncing was done so as to not break U-boot specific changes. The previous big sync was from Linux 4.1 by commit 98bd0e0d9b0c (kbuild: sync with Linux 4.1). The commits imported from Linux (some with adjustments) are: [1] commit 61754c18752ffb78145671e94f053fb202fff041 Author: Michal Marek <mmarek@suse.cz> kbuild: Allow arch Makefiles to override {cpp,ld,c}flags [2] commit 6dd3f13e4239a8c2b1e60687d7321bc0df614f33 Author: Michal Marek <mmarek@suse.com> kbuild: Do not pick up ARCH_{CPP,A,C}FLAGS from the environment [For all of the Kbuild changes within Linux] Signed-off-by: Michal Marek <mmarek@suse.com> [For applying within U-Boot] Signed-off-by: Tom Rini <trini@konsulko.com>
-rw-r--r--Makefile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 0af89e0a78..094457fdbd 100644
--- a/Makefile
+++ b/Makefile
@@ -592,6 +592,13 @@ ifneq ($(wildcard include/config/auto.conf),)
autoconf_is_old := $(shell find . -path ./$(KCONFIG_CONFIG) -newer \
include/config/auto.conf)
ifeq ($(autoconf_is_old),)
+
+# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
+# values of the respective KBUILD_* variables
+ARCH_CPPFLAGS :=
+ARCH_AFLAGS :=
+ARCH_CFLAGS :=
+
include config.mk
include arch/$(ARCH)/Makefile
endif
@@ -693,10 +700,11 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
include scripts/Makefile.extrawarn
-# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
-KBUILD_CPPFLAGS += $(KCPPFLAGS)
-KBUILD_AFLAGS += $(KAFLAGS)
-KBUILD_CFLAGS += $(KCFLAGS)
+# Add any arch overrides and user supplied CPPFLAGS, AFLAGS and CFLAGS as the
+# last assignments
+KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)
+KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS)
+KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS)
# Use UBOOTINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option