All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH 4/5] kbuild: disable KBUILD_MODNAME when building for mod.a
Date: Fri, 06 Jul 2018 09:03:04 +1000	[thread overview]
Message-ID: <878t6pz3o7.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <CAK7LNAT9deaBb0aiFW+00G-S4FTVdN5GX-n3HbEUR07nzHQUmQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2473 bytes --]

On Thu, Jul 05 2018, Masahiro Yamada wrote:

> 2018-07-05 6:54 GMT+09:00 NeilBrown <neilb@suse.com>:
>> On Wed, Jul 04 2018, Masahiro Yamada wrote:
>>
>>> 2018-07-04 7:14 GMT+09:00 NeilBrown <neilb@suse.com>:
>>>>
>>>> Where I've been using these patches I've sometimes been adding
>>>>
>>>>   ccflags-y += -DKBUILD_MODNAME='"FOO"'
>>>>
>>>> to Makefiles so that modules_params get handled correctly on non-module
>>>> builds.  I've thought about instead allowing "modobj-name" to be defined
>>>> and requiring that it be set if either modobj-[yn] is set.  Then it gets
>>>> used for the KBUILD_MODNAME when building modobj modules.
>>>>
>>>> Would you prefer to always require KBUILD_MODNAME, or to use a default
>>>> name for dynamic-debug?
>>>>
>>>> Thanks,
>>>> NeilBrown
>>>
>>>
>>> I prefer flat directory structure for modules.
>>> Most of modules fit in a single directory.
>>
>> I'd prefer that too in general.
>> But some modules are bigger than others and some times it helps to
>> sub-divide a module.
>> xfs, btrfs, ceph, net/dccp, and lustre all already use multiple
>> directories despite the poor support, so clearly some developers
>> like a more structured approach to organizing their code.
>> Wouldn't it be good to allow them to make full use of the kbuild system?
>
>
> xfs is quite big, but the others are not too bad.
> You can collect files into a single directory if you want.
> If you mind the namespace, one tip might be to group files with prefix.
> For example,
>
>   drivers/btrfs/tests/foo.o  ->  drivers/btrfs/test-foo.o

Certainly that is possible.  We could even place all of linux in a
single directory, but that would be a bad idea.  Subdividing large
bodies of code into files and then directories is a widely used
practice.  Why do you want make it hard for people to structure their
code in the way that seems most suitable to them?
My particular interest is lustre which has quite a few more
subdirectories than btrfs or xfs.  It currently builds as nearly a dozen
modules, one per directory (and that is just the client side).  This
requires a lot more exports than should be necessary, and exposes
internal detail unnecessarily. I would much rather it were fewer
modules.

>
> I do not want to introduce a mess to core build scripts.

What mess are you referring to?  The code I provided follows the style
of the current code and has the same general level of complexity as the
current code.  How is it a mess?

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2018-07-05 23:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18  4:55 [RFC PATCH 0/5] kbuild: build modules from code in multiple directories NeilBrown
2018-06-18  4:55 ` [PATCH 4/5] kbuild: disable KBUILD_MODNAME when building for mod.a NeilBrown
2018-06-27  5:52   ` Masahiro Yamada
2018-07-03 22:14     ` NeilBrown
2018-07-04 12:08       ` Masahiro Yamada
2018-07-04 21:54         ` NeilBrown
2018-07-05  9:06           ` Masahiro Yamada
2018-07-05 23:03             ` NeilBrown [this message]
2018-06-18  4:55 ` [PATCH 3/5] kbuild: support building of per-directory mod.a NeilBrown
2018-06-19  3:57   ` [PATCH 3/5 - v2] " NeilBrown
2018-06-18  4:55 ` [PATCH 1/5] kbuild: detect directories in components of a module NeilBrown
2018-06-18  4:55 ` [PATCH 2/5] kbuild: treat a directory listed in a composite object as foo/mod.a NeilBrown
2018-06-18  9:14   ` kbuild test robot
2018-06-18 22:30     ` NeilBrown
2018-06-18 22:30       ` NeilBrown
2018-06-18  4:55 ` [PATCH 5/5] kbuild: Add documentation for modobj-m NeilBrown
2018-06-18  8:20 ` [RFC PATCH 0/5] kbuild: build modules from code in multiple directories Christoph Hellwig
2018-06-19  4:05   ` NeilBrown
2018-06-19  4:47     ` Christoph Hellwig
2018-06-19  5:03       ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878t6pz3o7.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.