bug-make
[Top][All Lists]
Advanced

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

Empty variable treated as undefined


From: Pawlowsky, Marc
Subject: Empty variable treated as undefined
Date: Fri, 17 May 2002 10:32:55 -0400

If a variable has an empty value ifndef will enter the true branch.



> make EMPTY=0 all 
echo anything
anything
> make EMPTY=1 all 
makefile:12: *** variable is defined..  Stop.
> cat makefile
ifeq (1,${EMPTY})
  VAR=
else
  VAR=anything
endif

ifndef VAR
  VAR=${error variable is defined.}
endif

all:
        echo ${VAR}


This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.



reply via email to

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