help-make
[Top][All Lists]
Advanced

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

Re: inconsistency of 'emptiness'?


From: gk
Subject: Re: inconsistency of 'emptiness'?
Date: Thu, 23 Jan 2003 16:17:47 -0800

If forgot to add the following result, when FOO is set in the environment it works as you would hope:

address@hidden junk]$ export FOO=' '; make

FOO: origin=environment

This seems to indicate that the command line behavior is an anomaly/bug.
- Greg

At 03:23 PM 1/23/2003 -0800, I wrote:
I have noticed inconsistent behavior when a variable contains a single space:
* If the variable comes from the command-line, make thinks it is empty
* If the variable is set in the makefile, make knows it is not empty

# Makefile
.PHONY: test
i:=
ifdef internal
FOO:=$i #
endif

list:=hi there

# if not empty, we clear the list
ifneq ($(FOO),)
list:=
endif

test:
        @echo $(list)
        @echo FOO: origin=$(origin FOO)
#eof

address@hidden junk]$ make
hi there
FOO: origin=undefined
address@hidden junk]$ make FOO=' '
hi there
FOO: origin=command line
address@hidden junk]$ make internal=1

FOO: origin=file
address@hidden junk]$

Does this make sense? Is it documented? Is it a bug?

- Greg Keraunen
http://www.xmake.org
http://www.xmlmake.com



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

- Greg Keraunen
http://www.xmake.org
http://www.xmlmake.com





reply via email to

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