I'm writing a complex Makefile, and for safety I'd like
--warn-undefined-variables to always be on when any user runs this Makefile.
I've attempted to obtain this functionality by setting MAKEFLAGS to contain
--warn-undefined-variables, but so far this doesn't appear to work.
Here's my minimal makefile (minimal.mk):
MAKEFLAGS:=--warn-undefined-variables
$(info ${BAR})
I get no warning when I run:
$ make -f minimal.mk
But, I do get a warning when I explicitly add the flag at the command line:
$ make -f minimal.mk --warn-undefined-variables
I was concerned that maybe make doesn't interpret MAKFLAGS in this case
where I'm not recursively calling child makefiles. But, when using a single
character flag, MAKEFLAGS behaves as I expect (file called thisworks.mk):
MAKEFLAGS:=B
foo:
date > $@ <$@r>
$ make -f thisworks.mk
With the above, make correctly runs, unconditionally making the target as if
the --always-make flag had been specified.
I can also get MAKEFLAGS to behave as expected when setting
MAKEFLAGS=--always-run, so it's not simply a matter of single character
options versus multicharacter options.
Does anyone know what's going on here?
Thanks,
Lane
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make