This may not necessarily a bug but rather a missing/inconsistent feature in
make. I need a method to detect if a variable was defined, and it's ok if
the definition was set to blank.
So something like below should work. But if the first line was missing, it
should complain.
FOO :=
ifndef FOO
$(error FOO not defined)
endif
all:
@echo foo: $(FOO)
Another way to explain it is that the --warn-undefined-variables flag's
definition of an undefined variable is different from the IFNDEF function.
IFNDEF assumes a blank value means the variable is undefined.
Thanks,
Albert