help-make
[Top][All Lists]
Advanced

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

Re: Checking that required variables have been set


From: Elmar Kurgpold
Subject: Re: Checking that required variables have been set
Date: Wed, 25 Jun 2008 15:39:10 -0700

Hi, thank you for your help. This example didn't produce any output, ${missing} is empty.

Elmar

On Wed, Jun 25, 2008 at 1:57 PM, Philip Guenther <address@hidden> wrote:
On Wed, Jun 25, 2008 at 12:03 PM, ekurgpold <address@hidden> wrote:
...
> Then ${missing} has all the missing variables which can be echoed to the
> user. But then I need to have this ifndef... section for every variable and
> it's difficult to maintain and read. I've tried a number of things,
> including the following:
>
> required = SOMETHING SOMETHING_ELSE
>
> define CHECKIT
> ifeq ($$($(strip $(1))),)
>        echo $(1)
> endif
> endef
>
> missing = $(foreach var,$(required),$(call CHECKIT,$(var)))
>
> I'm using GNU make 3.81, but I'll need something that's fairly portable. Any
> ideas?  Thanks in advance...

missing = $(foreach var,${required},$(if $(findstring
undefined,$(origin ${var})),${var}))


Philip Guenther



--
Elmar Kurgpold
Dreamsonics
address@hidden
Mobile: 415-871-5915
Fax: 509-355-8234
reply via email to

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