confused about use of $(noconfig_targets)

Robert P. J. Day rpjday at mindspring.com
Thu Mar 2 20:58:00 UTC 2006


On Thu, 2 Mar 2006, Bernhard Fischer wrote:

> I'm in brain-turned-off-mode in this respect by now, but what's
> the difference between
> ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
> and
> ifneq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
> again?
>
> The former uses about two ! less than the latter, no?
> So what's the jazz this is all about exactly again?

two things.  first, that latter directive is what i consider more
comprehensible since the way you read it is, "once i remove (filter
out) all the noconfig targets from the goal list, is there anything
left?  if so, i need to include .config."  very simple to read.

the bigger issue is that the first directive will *fail* if you ever
want to extend the build structure to multiple targets.  the way you
read it is, "if i can't find *any* noconfig targets in the goal list,
then i'm assuming the goal needs config so i'll include it."

but that's going to fail with multiple mixed targets since you might
have both config and noconfig targets, but that first directive will
allow the noconfig target to drive the conditional.

it's just safer to write it the second way.

rday



More information about the busybox mailing list