public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* better kbuild support for drivers spanning multiple directories?
@ 2019-07-31 13:51 Jani Nikula
  0 siblings, 0 replies; only message in thread
From: Jani Nikula @ 2019-07-31 13:51 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek, linux-kbuild; +Cc: intel-gfx


Hi -

The drm/i915 [1][2] driver has grown quite big over the years: 400+
files with a total sloccount of 175k lines. A flat directory structure
just wasn't manageable anymore, and we opted to add subdirectories,
despite the general recommendation [3] not to do this.

Mostly, it works all right, with some quirks. For example, things like

	$ make drivers/gpu/drm/i915/<subdir>/<file>.o

do not work out of the box; we need to add subdir Makefiles to do things
like:

	subdir-ccflags-y += -I$(srctree)/$(src)/..

and include them using obj-y += <subdir>/ in the top level Makefile.

But the main problem really is having to have a top level Makefile
specifying everything, instead of being able to recurse into
subdirectoris with, say, lib-y += <subdir>/, and having that build a lib
within the subdirectory that gets linked into the parent level module.

Is there a better way? Could we have a better way?

BR,
Jani.


[1] drivers/gpu/drm/i915
[2] https://cgit.freedesktop.org/drm/drm-tip/tree/drivers/gpu/drm/i915
[3] Documentation/kbuild/modules.rst section 4.3


-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-31 13:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-31 13:51 better kbuild support for drivers spanning multiple directories? Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox