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 16:13:49 -0700

I get the same output, but now I see the problem. This code will work if the var is not in the include file at all, but it will ignore vars that have empty strings. So if you added:

SOMETHING_ELSE=

...then the code below would show no error. I'll have to make sure these vars have a value. Almost there..


On Wed, Jun 25, 2008 at 3:45 PM, Philip Guenther <address@hidden> wrote:
On Wed, Jun 25, 2008 at 3:39 PM, Elmar Kurgpold <address@hidden> wrote:
> Hi, thank you for your help. This example didn't produce any output,
> ${missing} is empty.

Here's my test case:

$ cat Makefile
required = SOMETHING SOMETHING_ELSE
SOMETHING=foo
missing = $(foreach var,${required},$(if $(findstring
undefined,$(origin ${var})),${var}))

all:
       @echo ${missing}
$ make
SOMETHING_ELSE
$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-unknown-openbsd4.3
$


What do you get when you try that?


Philip Guenther


_______________________________________________
Help-make mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-make



--
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]