Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5079527ybl; Mon, 26 Aug 2019 22:16:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyc9KWTcpv3tjqNKeAwtVNGnk/0A4HO7/rqSwGZKY8OfsNvQ90CsCbnoPyHwsQs8MQk6JTz X-Received: by 2002:a17:902:6a:: with SMTP id 97mr22766164pla.257.1566883014111; Mon, 26 Aug 2019 22:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566883014; cv=none; d=google.com; s=arc-20160816; b=TMEeTca0c7vRsutlXFUAR6DGtz9XMBgt6R7jrZoppWzuug80WNQcCTeY4YZf8hj1Ps /YKrJOo1foV4iz80yOy8JRZ+nqQ6AxFTNX4PZa0x6PmS+sQ76VNqgZ/bBAOGcy4w7ZKv SHJjAO4k9de/6P8OWcs1zipVn9JUpslgORM9aoN0qBThQyq750cp2wmL+vrtE3dpYXGA J/esRG07YbkQUvSZWQkmFLv/ixcUPFAor958f+YXWo2E9wLfJ26+pbgvvbLVQYdod19Y sBxAooX/zthbceVIWxPkO5YpNhD9w78HpIbVlgIc2CBhQYtZ8UpOzoVgWErs9C5/HR6o rioA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=zeAycLLY1+YwZS+X2e0YqPWel6Z800aRLRMBYLbHzjc=; b=DVtiG0gv/2PbGNIVwdq2Rs6zQ2kHRqpD6eqW0qxy8JD/Xuc/8gx2ePc1xfmuIpOyzG lj8jXFFU90uk+jutXGIAsN3NKAthO+by63QDB1vM7hhdKwEmj4K64pSrOrZA7WsSecCf Lst8vpMOr3gxuXshiK2vE2N6ESfDJ8/xn7a2diRrEn1IRoXKrrD7R7G0OBSkGjetsTP1 8I4hqdZJB3A2+yLXoKaOqbvhLR+hbBrBfjtOp+Os7jjJD2C24QRawUQWqSLbBvFhtFlG gbidEHEGFbS9duU9th8jzAHe48QJBv93wAivPQeozzMBWrERrAlGB67T7vsWKZCjFVq1 SSxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=QthS0PTX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn1si11423274plb.9.2019.08.26.22.16.37; Mon, 26 Aug 2019 22:16:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=QthS0PTX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729160AbfH0FPt (ORCPT + 99 others); Tue, 27 Aug 2019 01:15:49 -0400 Received: from conssluserg-05.nifty.com ([210.131.2.90]:35111 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725874AbfH0FPt (ORCPT ); Tue, 27 Aug 2019 01:15:49 -0400 Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com [209.85.217.50]) (authenticated) by conssluserg-05.nifty.com with ESMTP id x7R5Fajn025312 for ; Tue, 27 Aug 2019 14:15:36 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com x7R5Fajn025312 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1566882937; bh=zeAycLLY1+YwZS+X2e0YqPWel6Z800aRLRMBYLbHzjc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QthS0PTXWF5aBM+m7e1UvVbvlMqry/Rqocy8p7BOjVAsh3YG7fXpSvAJOTH+trtQV ThzxsmWaCM5IYVDckq79nclpCwzP5KLhAfrNCBIzPB0lkKT/xFcaqPDIyAXXLhi+ZK FasB5AzWFwEerSy9yysA1paGNQqbzgU6Bj4ghKePZtccCfkkBzupFqOR64KyxddEsA +DjHYFnNtkdQQ/P9E5QeA5tGSqhW4MQorW7lggHr80fG8TJmhiXjp1ZO0G9CBGAjJW YkYUJS+cPrpBl3i8DgeE82aU37/DrrUaPu0vsWWCWm2WeImXOKkBgfknaI3EbHlD7N 3AmnrLjbLD1gw== X-Nifty-SrcIP: [209.85.217.50] Received: by mail-vs1-f50.google.com with SMTP id i128so12600060vsc.7 for ; Mon, 26 Aug 2019 22:15:36 -0700 (PDT) X-Gm-Message-State: APjAAAWNjJLGm3452P7mUqZdhwlGAv8eYsuuxCXzP4Lg+jtyTtPjKGu6 zgw7dEcDNcWXeZGMkjJcPgsH94bEWsyZ/Ygoc2U= X-Received: by 2002:a67:fd97:: with SMTP id k23mr12661548vsq.179.1566882935496; Mon, 26 Aug 2019 22:15:35 -0700 (PDT) MIME-Version: 1.0 References: <20190821092658.32764-1-yamada.masahiro@socionext.com> <20190826113526.GA23425@infradead.org> In-Reply-To: <20190826113526.GA23425@infradead.org> From: Masahiro Yamada Date: Tue, 27 Aug 2019 14:14:59 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] riscv: add arch/riscv/Kbuild To: Christoph Hellwig Cc: linux-riscv@lists.infradead.org, Palmer Dabbelt , Linux Kernel Mailing List , Albert Ou , Paul Walmsley Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 26, 2019 at 8:35 PM Christoph Hellwig wrote: > > On Wed, Aug 21, 2019 at 06:26:58PM +0900, Masahiro Yamada wrote: > > Use the standard obj-y form to specify the sub-directories under > > arch/riscv/. No functional change intended. > > > > Signed-off-by: Masahiro Yamada > > Do you have a document what the grand scheme here is? There is a small documentation about "Makefile" vs "Kbuild" in Documentation/kbuild/modules.rst section 3.2 It is talking about external modules, but the benefit applies to arch/$(SRCARCH)/Kbuild as well. arch/$(SRCARCH)/Makefile is included by the top Makefile to specify arch-specific compiler flags, etc. On the other hand, arch/$(SRCARCH)/Kbuild, if exists, is included when Kbuild actually descends into arch/$(SRCARCH)/. This allows you to hierarchize the sub-directories to visit instead of specifying everything in flat in arch/$(SRCARCH)/Makefile. Major architectures are already doing this. See arch/x86/Kbuild arch/sparc/Kbuild arch/powerpc/Kbuild etc. (and arm64 also adopted this recently) The trick is "Kbuild" has precedence over "Makefile". If you are interested in the actual code, see line 41 of scripts/Makefile.build > Less of the magic > in arch/$(ARCH)/Makefile sounds like a good idea, but unless we have > a very specific split between the kbuild makefile and various override > I fear just splitting things up into two files doesn't really help much. Why not? -- Best Regards Masahiro Yamada