From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751456AbdKIFfh (ORCPT ); Thu, 9 Nov 2017 00:35:37 -0500 Received: from asavdk4.altibox.net ([109.247.116.15]:53562 "EHLO asavdk4.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751065AbdKIFff (ORCPT ); Thu, 9 Nov 2017 00:35:35 -0500 Date: Thu, 9 Nov 2017 06:35:29 +0100 From: Sam Ravnborg To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Rob Herring , Mark Rutland , Pantelis Antoniou , devicetree@vger.kernel.org, Arnd Bergmann , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Michal Marek , Michal Marek Subject: Re: [PATCH 1/2] kbuild: create built-in.o automatically if parent directory wants it Message-ID: <20171109053529.GA12717@ravnborg.org> References: <1510072307-16819-1-git-send-email-yamada.masahiro@socionext.com> <1510072307-16819-2-git-send-email-yamada.masahiro@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1510072307-16819-2-git-send-email-yamada.masahiro@socionext.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.2 cv=eqGd9chX c=1 sm=1 tr=0 a=ddpE2eP9Sid01c7MzoqXPA==:117 a=ddpE2eP9Sid01c7MzoqXPA==:17 a=kj9zAlcOel0A:10 a=7gkXJVJtAAAA:8 a=IVIVYO1bEUvHGqgSWusA:9 a=CjuIK1q_8ugA:10 a=E9Po1WZjFZOl8hwRPBS3:22 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masahiro. Thanks for picking this up. > A key point is, the parent Makefile knows whether built-in.o is needed > or not. If a subdirectory needs to create built-in.o, its parent can > tell the fact when Kbuild descends into it. Good observation! > > diff --git a/Makefile b/Makefile > index 008a4e5..cc0b618 100644 > --- a/Makefile > +++ b/Makefile > @@ -1003,7 +1003,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; > > PHONY += $(vmlinux-dirs) > $(vmlinux-dirs): prepare scripts > - $(Q)$(MAKE) $(build)=$@ > + $(Q)$(MAKE) $(build)=$@ need-builtin=1 The need-bultin may also be required for the shortcuts that allows one to use: make / example: make net/ And maybe selftest, documentation shortcuts too? Other than that - looks good. Reviewed-by: Sam Ravnborg Sam