help-make
[Top][All Lists]
Advanced

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

Resoved: inconsistency of 'emptiness'?


From: gk
Subject: Resoved: inconsistency of 'emptiness'?
Date: Wed, 05 Feb 2003 13:34:49 -0800

At 10:52 AM 1/28/2003 -0800, gk wrote:
At 05:23 PM 1/28/2003 +0100, Der Herr Hofrat wrote:
I still think it is a shell problem not make

It looks like der.herr was right after all!

The 'mysterious loss' of backslash, was the fault of my makefile: command rules interpret the '\ ' which make received.
Here is a modified version with output below.

There does not appear to be any bug except perhaps the lack of documentation that any leading space in command-line variable assignments is lost, just as makefile variables behave.

# Makefile
.PHONY: test

# test if FOO is empty
ifeq ($(FOO),)
empty:=FOO is empty
else
empty:=FOO is not empty
endif

test:
        @echo origin of FOO is: $(origin FOO)
        @echo 'previous test produced misleading output:'
        @echo FOO=$(FOO)#
        @echo 'the correct output is:'
        @echo FOO='$(FOO)'\#
        @echo $(empty)
#eof


address@hidden junk]$ make FOO=' \'
origin of FOO is: command line
previous test produced misleading output:
FOO=#
the correct output is:
FOO=\#
FOO is not empty
address@hidden junk]$ make FOO='\ '
origin of FOO is: command line
previous test produced misleading output:
FOO= #
the correct output is:
FOO=\ #
FOO is not empty






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





reply via email to

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