Basic Syntax
target: prerequisites | Rule format |
@echo 'hello' | Recipe (TAB required, @ hides command) |
.PHONY: all clean | Declare non-file targets |
VAR = value | Lazy assignment |
VAR := value | Immediate assignment |
VAR ?= value | Assign if not set |
$(VAR) | Variable expansion |
Automatic Variables
$@ | Target name |
$< | First prerequisite |
$^ | All prerequisites |
$* | Stem (matched pattern) |