From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E77A2C41518 for ; Wed, 20 Jan 2021 11:51:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C137F206EC for ; Wed, 20 Jan 2021 11:51:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387434AbhATLlR (ORCPT ); Wed, 20 Jan 2021 06:41:17 -0500 Received: from conssluserg-06.nifty.com ([210.131.2.91]:37037 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388854AbhATLHd (ORCPT ); Wed, 20 Jan 2021 06:07:33 -0500 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 10KB5ZgM031817; Wed, 20 Jan 2021 20:05:35 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 10KB5ZgM031817 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1611140735; bh=9TFgVC5GCS9ytVvloa3e3F44Yu5iAQkgD9AbrTeaqcw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IMZtSkWFdEhQtKTOT0gZsxpsYCNt/uAZH8lC5ajfERYjQFbhnOchPJ59lWQMDQK/D se1A+jc0Iw0JVcQypCcZoxhlZjerGf9jpCR7/ZhkT/XRZuJHKgc2/YiJZBMMMOOnfF Tl+WHKLvHkHegI+xhQybH6Vn/wo5lR9Y8TljHxl3N5+plt2EvDRjUyvxftr+CV7cOX Yxww+or12T+Q6OZJ47ydLlCRdqKFczQid4/FKhWyZwUj5BSHs8Mduo0AonftjrsC01 qnnkQKWx/qatuzpXsyDL828iED/5gz3YSgJ+ZxZIeJFjfp7tINO0hoM9ceSglzkTed 8sp8+cyv/Dwhg== X-Nifty-SrcIP: [209.85.216.41] Received: by mail-pj1-f41.google.com with SMTP id j12so1953714pjy.5; Wed, 20 Jan 2021 03:05:35 -0800 (PST) X-Gm-Message-State: AOAM530A9YJlRg7L4jO/OShEO1Uh/c22RUFcj1fS+n4D3uwTNIv/2M74 MWq94iwGVauqyTcGmHI+3RHD4XLYPtHPnGRbsKM= X-Google-Smtp-Source: ABdhPJwbUudTGF8VVk187qQE2APBClVB0j98S6UXW28gHOpp/o/770bNkeRb5JaravL/BlID2ZOYhZ7hMggk6fYt+M8= X-Received: by 2002:a17:90a:9a84:: with SMTP id e4mr5109138pjp.87.1611140734807; Wed, 20 Jan 2021 03:05:34 -0800 (PST) MIME-Version: 1.0 References: <6e57e9c84429416c628f1f4235c42a5809747c4c.1611124778.git.viresh.kumar@linaro.org> <20210120095541.f354ml4h36rfc4gx@vireshk-i7> In-Reply-To: <20210120095541.f354ml4h36rfc4gx@vireshk-i7> From: Masahiro Yamada Date: Wed, 20 Jan 2021 20:04:57 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V5 4/5] kbuild: Add support to build overlays (%.dtbo) To: Viresh Kumar Cc: Frank Rowand , Rob Herring , Pantelis Antoniou , Michal Marek , Vincent Guittot , DTML , Linux Kernel Mailing List , David Gibson , Bill Mills , Anmar Oueja , Linux Kbuild mailing list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 6:55 PM Viresh Kumar wrote: > > On 20-01-21, 17:58, Masahiro Yamada wrote: > > > +%.dtb %.dtbo: include/config/kernel.release scripts_dtc > > > $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ > > > > > > No, this is wrong because it does not work > > as grouped targets. > > > > You need to separate them. > > > > > > > > %.dtb: include/config/kernel.release scripts_dtc > > $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ > > > > %.dtbo: include/config/kernel.release scripts_dtc > > $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ > > > > > > > > > > See GNU make manual. > > > > > > "Pattern rules may have more than one target; however, every target > > must contain a % character. > > Pattern rules are always treated as grouped targets" > > > > https://www.gnu.org/software/make/manual/html_node/Pattern-Intro.html > > Hmm, okay I will do that. > > I did it this way because I saw similar stuff at some other places. I > am not a regular Makefile hacker, there is every chance I am reading > it wrong. > In grouped targets, a recipe must be able to create all the targets in a single invocation. > $ git grep "%.*%.*:" | grep Makefile > Makefile:%/config/auto.conf %/config/auto.conf.cmd %/generated/autoconf.h: $(KCONFIG_CONFIG) One single invocation of Kconfig generates three files, auto.conf, auto.conf.cmd, autoconf.h So, this is correct. > scripts/Makefile.build:$(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler asn1_compiler takes one source file, then outputs two files %.asn1.c and %.asn1.h So, this is correct. > scripts/Makefile.host:$(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE bison takes one source file, then outputs two files %.tab.c and %.tab.h So, this is correct. > scripts/genksyms/Makefile:$(obj)/pars%.tab.c $(obj)/pars%.tab.h: $(src)/pars%.y FORCE This is also a bison rule. Correct. > tools/perf/Documentation/Makefile:$(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : %.txt > tools/perf/Documentation/Makefile:$(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml These are out of scope of my maintenance coverage. I do not know whether they are correct or not. The DTC rule takes one source input, and one output file. It cannot generate .dtb and .dtbo at the same time. That is why a grouped target does not fit here. > -- > viresh -- Best Regards Masahiro Yamada