From: frowand.list@gmail.com (Frank Rowand)
To: linux-arm-kernel@lists.infradead.org
Subject: [RESEND PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs
Date: Wed, 5 Sep 2018 13:36:31 -0700	[thread overview]
Message-ID: <45fada0c-af5c-ee94-9878-8ea78a34da26@gmail.com> (raw)
In-Reply-To: <1536048344-9995-3-git-send-email-t-kristo@ti.com>
On 09/04/18 01:05, Tero Kristo wrote:
> Currently the makefile is setup in such manner that even if
> we build a DT file in a subdirectory under arch/arm/boot/dts,
> it gets built based on the base boot/dts/Makefile rules.
> This patch modifies the base makefile in such manner, that
> it detects which makefile to use based on build target path.
> This allows setting for example per-directory DTC_FLAGS and
> using those for the subdir build. The dtbdir local variable
> is setup to target to the build path.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  arch/arm/Makefile | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index ab555a0..b7c21e8 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -339,8 +339,10 @@ $(BOOT_TARGETS): vmlinux
>  $(INSTALL_TARGETS):
>  	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
>  
> +%.dtb %.dtbo: dtbdir = $(patsubst %/,%,$(patsubst %./,%,$(boot)/dts/$(dir $@)))
> +
>  %.dtb %.dtbo: | scripts
> -	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
> +	$(Q)$(MAKE) $(build)=$(dtbdir) MACHINE=$(MACHINE) $(boot)/dts/$@
>  
>  PHONY += dtbs dtbs_install
>  
> 
The makefile magic to handle subdirectories below $(boot)/dts/ already
works properly to have Makefiles in $(boot)/dts/, using the following
rule in arch/arm64/Makefile:
%.dtb: scripts
        $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
I don't understand why that works for arm64, but it should work the
same way for arm.  Or if arch/arm is missing another piece from
arch/arm64 we should be consistent with however the make system
specifies it in arch/arm64
next prev parent reply	other threads:[~2018-09-05 20:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 12:47 [PATCHv2 0/4] ARM build infra changes to support building .dtbos Tero Kristo
2018-08-31 12:47 ` [PATCHv2 1/4] ARM: dts: add support for building DT overlays Tero Kristo
2018-08-31 12:47 ` [PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs Tero Kristo
2018-08-31 12:47 ` [PATCHv2 3/4] arm64: dts: add support for building DT overlays Tero Kristo
2018-08-31 12:47 ` [PATCHv2 4/4] arm64: dts: add support for per sub-dir makefiles for DT building Tero Kristo
2018-09-04  8:05 ` [RESEND PATCHv2 0/4] ARM build infra changes to support building .dtbos Tero Kristo
2018-09-04  8:05   ` [RESEND PATCHv2 1/4] ARM: dts: add support for building DT overlays Tero Kristo
2018-09-05 20:36     ` Frank Rowand
2018-09-05 21:13       ` Rob Herring
2018-09-06 21:00         ` Frank Rowand
2018-09-04  8:05   ` [RESEND PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs Tero Kristo
2018-09-05 20:36     ` Frank Rowand [this message]
2018-09-05 21:38       ` Rob Herring
2018-09-04  8:05   ` [RESEND PATCHv2 3/4] arm64: dts: add support for building DT overlays Tero Kristo
2018-09-05 20:36     ` Frank Rowand
2018-09-04  8:05   ` [RESEND PATCHv2 4/4] arm64: dts: add support for per sub-dir makefiles for DT building Tero Kristo
2018-09-05 20:37     ` Frank Rowand
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=45fada0c-af5c-ee94-9878-8ea78a34da26@gmail.com \
    --to=frowand.list@gmail.com \
    --cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).