From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Subject: Re: [PATCH v3 6/9] kbuild: consolidate Devicetree dtb build rules Date: Tue, 11 Sep 2018 10:40:07 -0500 Message-ID: References: <20180910150403.19476-1-robh@kernel.org> <20180910150403.19476-7-robh@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20180910150403.19476-7-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org To: devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Masahiro Yamada Cc: Frank Rowand , Michal Marek , Vineet Gupta , Russell King , Catalin Marinas , Yoshinori Sato , Michal Simek , Ralf Baechle , James Hogan , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Chris Zankel , Max Filippov , Linux Kbuild mailing list , arcml , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" moderated list List-Id: devicetree@vger.kernel.org On Mon, Sep 10, 2018 at 10:04 AM Rob Herring wrote: > > There is nothing arch specific about building dtb files other than their > location under /arch/*/boot/dts/. Keeping each arch aligned is a pain. > The dependencies and supported targets are all slightly different. > Also, a cross-compiler for each arch is needed, but really the host > compiler preprocessor is perfectly fine for building dtbs. Move the > build rules to a common location and remove the arch specific ones. This > is done in a single step to avoid warnings about overriding rules. > > The build dependencies had been a mixture of 'scripts' and/or 'prepare'. > These pull in several dependencies some of which need a target compiler > (specifically devicetable-offsets.h) and aren't needed to build dtbs. > All that is really needed is dtc, so adjust the dependencies to only be > dtc. > > This change enables support 'dtbs_install' on some arches which were > missing the target. [...] > @@ -1215,6 +1215,33 @@ kselftest-merge: > $(srctree)/tools/testing/selftests/*/config > +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig > > +# --------------------------------------------------------------------------- > +# Devicetree files > + > +ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),) > +dtstree := arch/$(SRCARCH)/boot/dts > +endif > + > +ifdef CONFIG_OF_EARLY_FLATTREE This can be true when dtstree is unset. So this line should be this instead to fix the 0-day reported error: ifneq ($(dtstree),) > + > +%.dtb : scripts_dtc > + $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ > + > +PHONY += dtbs dtbs_install > +dtbs: scripts_dtc > + $(Q)$(MAKE) $(build)=$(dtstree) > + > +dtbs_install: dtbs > + $(Q)$(MAKE) $(dtbinst)=$(dtstree) > + > +all: dtbs > + > +endif