[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gmake: testing if a var is [un]defined
From: |
Ernest |
Subject: |
gmake: testing if a var is [un]defined |
Date: |
Thu, 13 Jan 2005 15:37:53 -0600 |
User-agent: |
Xnews/5.04.25 |
Consider a variable called FOO...is there a more efficient/quick/simple way
to test if this variable is defined (vs. undefined) at *runtime* than as
follows? Note that "defined" *can* mean an empty value ("FOO=").
# echo "no" if FOO is undefined
# or "yes" if FOO is defined
foo:
echo $(if $(findstring undefined,$(origin FOO)),no,yes)
Thanks,
Ernest
- gmake: testing if a var is [un]defined,
Ernest <=