mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-01-28 18:10:51 +00:00
1eff20f6f6
Rework the single "?=" operator to instead allow a "?" modifier to be prepended to ANY assignment operator. If "?" is given then the variable is assigned (using whatever operator comes next) if and only if the variable is not already defined. If it is defined then no action is taken (the right-hand side is not expanded, etc.) * NEWS: Announce this new feature. * doc/make.texi: Modify the documentation around assignment operators. * src/variable.h: Remove the f_conditional variable flavor. (do_variable_definition): Add an argument specifying conditional. * src/variable.c (parse_variable_definition): Use the existing flag "conditional" to remember if we saw "?" rather than the flavor. When we see "?" skip it and continue trying to parse an assignment. (try_variable_definition): Pass condition to do_variable_definition(). (initialize_file_variables): Ditto. (do_variable_definition): Check for conditional up-front: quit if set. Remove handling of obsolete f_conditional flavor. * src/read.c (eval_makefile): MAKEFILE_LIST is not conditional. (do_define): Unset conditional for define with no operator. Pass the conditional flag to do_variable_definition(). (construct_include_path): .INCLUDE_DIRS is not conditional. * src/load.c (load_file): .LOADED is not conditional. * tests/scripts/variables/conditional: Add new tests. |
||
---|---|---|
.. | ||
automatic | ||
conditional | ||
CURDIR | ||
DEFAULT_GOAL | ||
define | ||
EXTRA_PREREQS | ||
flavors | ||
GNUMAKEFLAGS | ||
INCLUDE_DIRS | ||
LIBPATTERNS | ||
MAKE | ||
MAKE_RESTARTS | ||
MAKECMDGOALS | ||
MAKEFILES | ||
MAKEFLAGS | ||
MAKELEVEL | ||
MFILE_LIST | ||
negative | ||
private | ||
SHELL | ||
special | ||
undefine | ||
WARNINGS |