Makefile cheatsheetEdit

Created , updated

Automatic variables

  • $@: file being generated
  • $<: first pre-requisite

Functions

  • wildcard
  • addprefix

Order-only prerequisites

# "target" depends on "dependency" but last-modified date is not considered
target: | dependency

FORCE targets

# "target" always gets built...
target: FORCE

# ...because it depends on this non-existent file
FORCE:

See also:

External resources