Re: 2.6 Makefile replacement for VPATH
From: Kyle Hubert
Date: Thu Jun 25 2009 - 16:36:22 EST
On Thu, Jun 25, 2009 at 07:47:48PM +0200, Sam Ravnborg wrote:
> > 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.
>
> Several obvious solutions.
>
> a) Let the same driver handle multiple devices - we do this in very often.
>
> b) Keep all shared functionality in a dedicated lib* module, and
> have thin wrappers for the actual drivers. See libata for example.
Neither one of them were options for us, since header files also have
macros for defining MMR addresses in the hardware. This can change
from device to device, so the code becomes more complicated to
organize that in a shared driver/library.
> c) The ugly where you have a thin dedicated .C file for each driver
> that includes the source they share.
Thanks for the suggestion. We tried this, and it does indeed solve our
problem. It may be ugly, but it's the cleanest of the four solutions.
Thank you for the response,
-Kyle Hubert
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/