Re: [RFC PATCH 0/5] kbuild: build modules from code in multiple directories.

From: Christoph Hellwig
Date: Mon Jun 18 2018 - 04:20:31 EST


On Mon, Jun 18, 2018 at 02:55:20PM +1000, NeilBrown wrote:
> This set of patches makes it possible to build a module from
> code in multiple directories without needing to list files from one
> directory in the Makefile of another directory.
>
> The code was developed for lustre (which is now out-of-tree :-( ) but
> can be useful elsewhere, such as for xfs and btrfs and others.
>
> In fs/xfs/Makefile the section:
>
> xfs-y += $(addprefix libxfs/, \
> xfs_ag.o \
> xfs_alloc.o \
> .....
>
> could become
>
> xfs-y += libxfs/
>
> and then in fs/xfs/libxfs/Makefile we would have
>
> modobj-$(CONFIG_XFS_FS) += xfs_ag.o \
> xfs_alloc.o \
> .....
>
> A similar process could move filenames for scrub/* from the
> fs/xfs/Makefile to fs/xfs/scrub/Makefile

How about you actually convert it as an example?