Monday, June 16, 2008

All the symbols that usually appear in Makefiles

$@ The file name of the target.

$% The target member name, when the target is an archive member.

$< The name of the first dependency.

$? The names of all the dependencies that are newer than the target, with spaces between them.

$^ and $+
The names of all the dependencies, with spaces between them. For dependencies which are archive members,
only the member named is used (see section Using make to Update Archive Files). The value of $^ omits
duplicate dependencies, while $+ retains them and preserves their order.

$* The stem with which an implicit rule matches (see section How Patterns Match).

$(@D) and $(@F)
The directory part and the file-within-directory part of $@.

$(*D) and $(*F)
The directory part and the file-within-directory part of $*.

$(%D) and $(%F)
The directory part and the file-within-directory part of $%.

$( The directory part and the file-within-directory part of $<.

$(^D) and $(^F)
The directory part and the file-within-directory part of $^.

$(+D) and $(+F)
The directory part and the file-within-directory part of $+.

$(?D) and $(?F)
The directory part and the file-within-directory part of $?

No comments: