[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question on wildcard support in conditionals (ifeq, ifneq, etc)?
From: |
Philip Guenther |
Subject: |
Re: Question on wildcard support in conditionals (ifeq, ifneq, etc)? |
Date: |
Mon, 29 Sep 2008 19:47:32 -0700 |
On Mon, Sep 29, 2008 at 4:50 PM, Randy Kao <address@hidden> wrote:
> Thanks for the quick feedback.
>
> ifeq (apple_, $(findstring apple_, $(TARGET)))
> ...
> endif
>
> I was hoping for something a little less convoluted but this seems to do the
> trick.
If you don't like the duplication of "apple_", then flip the test:
ifneq (,$(findstring apple_,$(TARGET)))
...
endif
Also, $(filter) may be a better choice than $(findstring), as it won't
have false positives when the string is in the middle of the word, ala
"crabapple_jelly":
ifneq (,$(filter apple_%,$(TARGET)))
...
endif
Philip Guenther