make/tests/scripts
Paul Smith 1eff20f6f6 Support conditional modifiers on all assignment operators
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.
2024-01-28 14:20:47 -05:00
..
features [SV 65211] Fix load and loadapi tests. 2024-01-27 16:40:36 -05:00
functions [SV 65172] Avoid buffer overruns when expanding for $(shell ...) 2024-01-27 16:40:36 -05:00
misc tests: Run each file in a separate directory 2023-04-02 17:32:09 -04:00
options [SV 64571] Add --print-targets option 2024-01-08 23:31:58 -05:00
targets * tests/scripts/targets/WAIT: Add whitespace to avoid W32 issues 2023-04-02 17:30:27 -04:00
variables Support conditional modifiers on all assignment operators 2024-01-28 14:20:47 -05:00
vms Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
test_template Update the test template. A few fixes in run_make_test(). 2004-09-22 04:36:17 +00:00