Pass `$` through to the shell.
Section: Recipe portability
Escape dollar signs in recipes
makefile
makefile
print-pid:
@echo $$PPIDExplanation
Make uses `$` for variable expansion, so shell variables need `$$`.
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 Recipe portability
Use shell short-circuit safely
Stop on failure explicitly within one recipe line.
Use tabs for recipe lines
Indent recipe commands with a tab character.
Avoid `.ONESHELL` when targeting POSIX make
Keep recipe-line semantics standard.
POSIX-style portable rule
Write simple, explicit file rules compatible with standard make.
Avoid eval for POSIX portability
Prefer explicit rules over GNU metaprogramming.