Capture shell command output at parse time.

Section: Shell, call, eval, and generated rules

shell function

makefile
makefile
GIT_SHA := $(shell git rev-parse --short HEAD)
Explanation

Use sparingly; every call runs during parsing.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Shell, call, eval, and generated rules
call macro with arguments
Invoke a user-defined macro like a function.
OpenIn sheetmakefilesame section
eval generated rules
Generate new rules dynamically.
OpenIn sheetmakefilesame section
value raw variable text
Read a variable without expanding it.
OpenIn sheetmakefilesame section
file function
Write content to a file from make.
OpenIn sheetmakefilesame section
warning and error functions
Emit diagnostics or abort parsing.
OpenIn sheetmakefilesame section
info tracing
Print information during parsing.
OpenIn sheetmakefilesame section