public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kyle Hubert <khubert@cray.com>
To: linux-kernel@vger.kernel.org
Cc: Igor Gorodetsky <igorodet@cray.com>
Subject: 2.6 Makefile replacement for VPATH
Date: Thu, 25 Jun 2009 09:39:17 -0700	[thread overview]
Message-ID: <20090625163916.GN6248@cray.com> (raw)


Hi. I'm requesting information about how to handle a VPATH situation
for drivers in the 2.6 build, with the corresponding solution that we
have.

I refer to VPATH with regards to the situation where you can have
multiple Makefiles target the same source file to build different
objects. In particular, we are using the same source file recompiled
with different options to be able to support different devices.

This is where VPATH can help in the GNU Makefile tradition. Yet, the
2.6 build system has multiple stages to build driver modules, and as
such the VPATH variable is not carried forward. How do other people
handle this?

If you use an obj-m that refers via relative directories to the source
file, ie: "../src", then the two resulting object files have the same
name and the last compiled one will be listed in
.tmp_versions/drv.mod. This will be the only one linked into an
drv.ko.

If you use a multi-object, ie: drv-objs, then you can split the two
drivers into two different names. Each multi-object's parts are
compiled and linked into the multi-object's .o during the compilation
stage, and two .mod files will be created. Thus, two .kos will be
linked during the final stage. This appears to be a solution. However,
during the compilation stage, the two multi-objects will recompile the
original "../src/src.o" intermediary object. This affects the date of
the intermediary .o, and each subsequent execution of the Make command
will consider it a candidate for recompile, and the two drivers will
be rebuilt, regardless of any source code changes.

How do others handle this? Do they just move their driver outside of
the kernel Makefiles so they can iterate through the two builds via
traditional Make routines?

Thank you,
-Kyle Hubert

             reply	other threads:[~2009-06-25 17:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-25 16:39 Kyle Hubert [this message]
2009-06-25 17:47 ` 2.6 Makefile replacement for VPATH Sam Ravnborg
2009-06-25 20:35   ` Kyle Hubert

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=20090625163916.GN6248@cray.com \
    --to=khubert@cray.com \
    --cc=igorodet@cray.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