help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to test if a variable is something or empty?


From: Philip Guenther
Subject: Re: How to test if a variable is something or empty?
Date: Fri, 24 Oct 2008 14:37:41 -0700

On Fri, Oct 24, 2008 at 1:59 PM, Peng Yu <address@hidden> wrote:
> I have the following code. I'm wondering how to put them together into
> one if statement?
>
> ifeq ($(MAKECMDGOALS), all)
> -include .dep
> endif
>
> ifeq ($(MAKECMDGOALS), )
> -include .dep
> endif

Don't you _really_ want to test whether they are doing a "make clean"?  If so:

# don't include .dep if they're doing a make clean
ifeq ($(filter clean,$(MAKECMDGOALS)),)
 -include .dep
endif

If there are other fake targets that should disable .dep inclusion,
just include them in the first argument to $(filter)


Philip Guenther




reply via email to

[Prev in Thread] Current Thread [Next in Thread]