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