public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Steven J. Hill" <sjhill@cotw.com>
To: linux-kernel@vger.kernel.org
Subject: Building multipart modules with subdirectories...
Date: Fri, 03 Aug 2001 13:40:14 -0500	[thread overview]
Message-ID: <3B6AF00E.C66F69DE@cotw.com> (raw)
In-Reply-To: <UTC200107021303.PAA496134.aeb@vlet.cwi.nl>

This question has to do with the kernel build system as it relates to
building a driver both as static and as a module. I have a solution,
but I don't like it. Please read on...

I have driver that is rather complex and in order to maintain it, the
module is broke up into 17 different subdirectories. I am maintaining it
and I am trying to integrate it into the kernel build system. No, I am
not the original architect. Regardless, in the top level Makefile of
my driver directory I have the statement:

subdir-$(CONFIG_FOO_DRV) += $(17 directories' names)

When the module is built, the 'foodrv.o' object is placed in the top
level directory. The problem is that when a 'make modules_install' is
done, it uses the directories defined in 'subdir-$(CONFIG_FOO_DRV)' and
proceeds to fail installing in each of the subdirectories because there
is no target in their makefiles and nor should there be since their
objects are part of the top-level module object.

I could use the 'subdir-' directive above only when I am statically
linking in the driver, hence place it in an 'if' statement. Then when
I build the driver as a module, I manually enter each directory and
do a 'make -C <dir> modules'. However, since the 'subdir-' definition
would be missing if I am building as a module, no '.depend' files are
generated in my subdirectories when I do a 'make dep' which means if
I change a critical header file in my driver's common include
directory, the .c files using it will not be rebuilt! If I could
override the 'modules_install' target in each of my subdirectories
makefiles the problem would be solved. This is possible according to
a solution in the info pages for make, but it requires me to create a
GNUmakefile in each of my directories. Can someone perhaps give me
some ideas for this dilemna? Thanks.

-Steve

-- 
 Steven J. Hill - Embedded SW Engineer

  reply	other threads:[~2001-08-03 18:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-02 13:03 [PATCH] more SAK stuff Andries.Brouwer
2001-08-03 18:40 ` Steven J. Hill [this message]
2001-08-04 10:30   ` Building multipart modules with subdirectories Keith Owens

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=3B6AF00E.C66F69DE@cotw.com \
    --to=sjhill@cotw.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox