E.g. in a Makefile to have
obj-$(CONFIG_FOO) += common-thing.o foo.o obj-$(CONFIG_BAR) += common-thing.o bar.o
where both FOO and BAR can be enabled at the same time?
Looks a bit suspect to me. My instinct would be to invent CONFIG_BAZ to compile common-thing.o and make FOO and BAR select it. Or possibly some makefile conditional OR expression I can't think of off the top of my head.
On 7 August 2013 18:52, Jon Medhurst (Tixy) tixy@linaro.org wrote:
E.g. in a Makefile to have
obj-$(CONFIG_FOO) += common-thing.o foo.o obj-$(CONFIG_BAR) += common-thing.o bar.o
where both FOO and BAR can be enabled at the same time?
I have been in this kind of problems earlier..
Looks a bit suspect to me. My instinct would be to invent CONFIG_BAZ to compile common-thing.o and make FOO and BAR select it.
This is the best I would say.
Or possibly some makefile conditional OR expression I can't think of off the top of my head.
In this case you need to use CONFIG_FOO twice.. It would be something like this (obviously syntax is broken):
obj-$(CONFIG_FOO) += foo.o obj-$(CONFIG_BAR) += bar.o obj-$(CONFIG_FOO OR CONFIG_BAR) += common-thing.o
I would prefer the first approach compared to this one. And second is probably the best.
On Wed, 2013-08-07 at 19:30 +0530, Viresh Kumar wrote:
On 7 August 2013 18:52, Jon Medhurst (Tixy) tixy@linaro.org wrote:
E.g. in a Makefile to have
obj-$(CONFIG_FOO) += common-thing.o foo.o obj-$(CONFIG_BAR) += common-thing.o bar.o
where both FOO and BAR can be enabled at the same time?
I have been in this kind of problems earlier..
Looks a bit suspect to me. My instinct would be to invent CONFIG_BAZ to compile common-thing.o and make FOO and BAR select it.
This is the best I would say.
Just looked at this, and FOO and BAR are generic kernel options so it's probably messy getting them to select an ARM config which is a mere implementation detail. I'll probably leave the problem to the person who's code I'm reviewing ;-)
Or possibly some makefile conditional OR expression I can't think of off the top of my head.
In this case you need to use CONFIG_FOO twice.. It would be something like this (obviously syntax is broken):
obj-$(CONFIG_FOO) += foo.o obj-$(CONFIG_BAR) += bar.o obj-$(CONFIG_FOO OR CONFIG_BAR) += common-thing.o
I would prefer the first approach compared to this one. And second is probably the best.
Thanks.
On Wed, Aug 07, 2013 at 03:37:43PM +0100, Jon Medhurst (Tixy) wrote:
Just looked at this, and FOO and BAR are generic kernel options so it's probably messy getting them to select an ARM config which is a mere implementation detail. I'll probably leave the problem to the person who's code I'm reviewing ;-)
You can do something like this:
config BAZ bool default y if FOO default y if BAR
or
config BAZ tristate default FOO
plus variations on the theme.
linaro-kernel@lists.linaro.org