From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masahiro Yamada Date: Thu, 20 Feb 2014 17:24:30 +0900 Subject: [U-Boot] [PATCH] kbuild,tegra124: add dummy obj- for Kbuild In-Reply-To: <5304DD7E.7070104@wwwdotorg.org> References: <20140219154659.5f1ba763@lilith> <5304DD7E.7070104@wwwdotorg.org> Message-ID: <20140220172429.A188.AA925319@jp.panasonic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Stephen, On Wed, 19 Feb 2014 09:36:14 -0700 Stephen Warren wrote: > On 02/19/2014 07:46 AM, Albert ARIBAUD wrote: > > Hi Masahiro, > > > > On Wed, 19 Feb 2014 22:26:43 +0900, Masahiro Yamada > > wrote: > > > >> In Kbuild, every makefile must have non-empty obj- or obj-y. > >> Otherwise, built-in.o will not be created and the link stage > >> will fail. > ... > >> diff --git a/arch/arm/cpu/armv7/tegra124/Makefile b/arch/arm/cpu/armv7/tegra124/Makefile > ... > >> +# necessary to create built-in.o > >> +obj- := __dummy__.o > > obj- or obj-y? Definitely obj-. If you add a non-existing object to obj-y, build will fail. > Adding something to obj-, which presumably isn't used at all, seems very > odd. > > > Is there really no other way than to specify an unexisting __dummy__.o > > in order to build a useless built-in.o? > > I haven't looked at Kbuild at all, but in the build systems I've > written, for each sub-directory makefile that was included, the > makefiles would include a "pre-makefile" first and a "post-makefile" > after. The "post-makefile" could easily do something like: > > ifeq ($(obj-y),) > obg-y := __dummy__.o > endif You mean ifeq ($(obj-y),) obj- := __dummy__.o endif should be put in a common part(scripts/Makefile.build) ? No, no. We can't do this. It has a side effect. If we put it in the common part, build-in.o will be generated in all sub-directories, including tools/, tools/env, examples/standalone/, etc. We do not want built-in.o in host progs / standalone progs directories. Best Regards Masahiro Yamada