[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Checking that required variables have been set
From: |
Philip Guenther |
Subject: |
Re: Checking that required variables have been set |
Date: |
Wed, 25 Jun 2008 13:57:37 -0700 |
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