Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/usr.bin/make



Module Name:    src
Committed By:   sjg
Date:           Wed Nov 12 22:14:08 UTC 2025

Modified Files:
        src/usr.bin/make: make.1 var.c
        src/usr.bin/make/unit-tests: Makefile
Added Files:
        src/usr.bin/make/unit-tests: varmod-sun-shell1.exp varmod-sun-shell1.mk

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.387 -r1.388 src/usr.bin/make/make.1
cvs rdiff -u -r1.1172 -r1.1173 src/usr.bin/make/var.c
cvs rdiff -u -r1.372 -r1.373 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/varmod-sun-shell1.exp \
    src/usr.bin/make/unit-tests/varmod-sun-shell1.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index