[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Logical AND, OR, XOR operators inside ifeq ... endif construct condi
From: |
Ken Smith |
Subject: |
Re: Logical AND, OR, XOR operators inside ifeq ... endif construct condition. |
Date: |
Fri, 28 Oct 2005 16:05:17 -0400 |
User-agent: |
mutt-ng/devel-r445 (Linux) |
On Fri, Oct 28, 2005 at 03:28:45PM -0400, Paul D. Smith wrote:
> %% "Boucher, Jean" <address@hidden> writes:
>
> bj> Also, one of the situation I'm trying to test for is the empty
> bj> string (in my previous example, say Y=`'), which I believe I can't
> bj> test in this manner:
>
> bj> ifeq ($(var),$(filter $(var),X `'))
> bj> ...
> bj> endif
>
> Nope, you can't do that. Hm. That's tricky, because the empty string
> in GNU make means "false".
>
> You can use $(if ...)... a bit strange with an if function inside an
> ifeq, but it would work. You'd have to write it specially: using the
> GMSL version John created I don't think will work because the value
> you're comparing it to is itself false.
>
> Something like this would work I think (untested):
>
> ifeq ($(var),$(if $(var),$(filter $(var),X),$(var)))
You may be able to get by with this if conditional 1 and conditional 2
are mutually exclusive or Action is not sensitive to multiple
execution.
1)
define Action
the
stuff
you
want
to
do
endef
ifeq (conditional 1)
$(Action)
endif
ifeq (conditional 2)
$(Action)
endif
Ken