mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: barebox@lists.infradead.org
Cc: Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH v2 3/4] kbuild: support ccflags-y, asflags-y, cppflags-y, and ldflags-y
Date: Wed, 22 Apr 2020 15:37:31 +0900	[thread overview]
Message-ID: <20200422063732.1584550-3-masahiroy@kernel.org> (raw)
In-Reply-To: <20200422063732.1584550-1-masahiroy@kernel.org>

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>
---

Changes in v2:
  - add ldflags-y

 drivers/pci/Makefile |  2 --
 scripts/Makefile.lib | 12 ++++++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 3ca670865..d227619ed 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -5,8 +5,6 @@ obj-y		+= pci.o bus.o pci_iomap.o
 
 ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG
 
-CPPFLAGS += $(ccflags-y)
-
 obj-$(CONFIG_PCI_MVEBU)	+= pci-mvebu.o pci-mvebu-phy.o
 obj-$(CONFIG_PCI_TEGRA) += pci-tegra.o
 obj-$(CONFIG_PCIE_DW) += pcie-designware.o pcie-designware-host.o
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index d4c2ed15b..5a5d6a3a6 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		 \
-- 
2.25.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2020-04-22  6:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22  6:37 [PATCH v2 1/4] riscv: remove meaningless LDFLAGS addition Masahiro Yamada
2020-04-22  6:37 ` [PATCH v2 2/4] mips: rename ldflags-y to mips-ldflags-y Masahiro Yamada
2020-04-22  6:37 ` Masahiro Yamada [this message]
2020-04-22  6:37 ` [PATCH v2 4/4] kbuild: prefix compiler flag variables with KBUILD_ Masahiro Yamada
2020-04-23  6:26 ` [PATCH v2 1/4] riscv: remove meaningless LDFLAGS addition Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200422063732.1584550-3-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox