summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-04-22 15:37:31 +0900
committerSascha Hauer <s.hauer@pengutronix.de>2020-04-27 21:16:43 +0200
commit331eecaa77074726cf7be045afad5eea5969f477 (patch)
tree7a9646e54d7da89583230299892a69bba62cc7ac /scripts
parentc28fcee83f78bda4cbab604a2c30bfa03f991b6d (diff)
downloadbarebox-331eecaa77074726cf7be045afad5eea5969f477.tar.gz
barebox-331eecaa77074726cf7be045afad5eea5969f477.tar.xz
kbuild: support ccflags-y, asflags-y, cppflags-y, and ldflags-y
Some Makefiles use ccflags-y, but it is not actually supported. Support ccflags-y, asflags-y, cppflags-y, and ldflags-y like Linux. Remove the workaround in drivers/pci/Makefile. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.lib12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index d4c2ed15b6..5a5d6a3a6c 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -1,5 +1,9 @@
# SPDX-License-Identifier: GPL-2.0
# Backward compatibility
+asflags-y += $(EXTRA_AFLAGS)
+ccflags-y += $(EXTRA_CFLAGS)
+cppflags-y += $(EXTRA_CPPFLAGS)
+ldflags-y += $(EXTRA_LDFLAGS)
always-y += $(always)
hostprogs += $(hostprogs-y) $(hostprogs-m)
@@ -128,9 +132,9 @@ basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
-_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(target-stem).o)
-_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(target-stem).o)
-_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(target-stem).lds)
+_c_flags = $(CFLAGS) $(ccflags-y) $(CFLAGS_$(target-stem).o)
+_a_flags = $(AFLAGS) $(asflags-y) $(AFLAGS_$(target-stem).o)
+_cpp_flags = $(CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(target-stem).lds)
ifeq ($(CONFIG_UBSAN),y)
_CFLAGS_UBSAN = $(eval _CFLAGS_UBSAN := $(CFLAGS_UBSAN))$(_CFLAGS_UBSAN)
@@ -167,7 +171,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags)
-ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS)
+ld_flags = $(LDFLAGS) $(ldflags-y)
dtc_cpp_flags = -Wp,-MD,$(depfile).pre -nostdinc \
-I$(srctree)/arch/$(SRCARCH)/dts/include \