History log of /src/usr.bin/make/unit-tests/varmod-sun-shell1.exp
Revision Date Author Comments
# 1.1 12-Nov-2025 sjg

make: add :sh1 to run command on first reference only

There are several ways to assign the output of a command to
a variable, two common ones:

CMD= command
VAR!= ${CMD}

is evaluated when the above line is read, so VAR is set
even if it is never used.

VAR = ${CMD:sh}

is only evaluated when referenced, but command will be run for
each reference.

We now add :sh1 which will only run command on first reference.
The output will be cached in .MAKE.SH1.VAR which will be used for
subsequent references.

Reviewed by: rillig