next up previous
Next: Suffix rules Up: A sample makefile and Previous: Special dependencies

Special macros

 

Now all those $@ thingees that appear in the example above and elsewhere in the makefile are clearly not plain old macros, since they're never defined and yet this makefile works quite well, I promise. The reason is that there are a number of special macros with one character names that are only useable as part of a dependency rule:

$@
The file name of the target.

$<
The name of the first dependency.

$*
The part of a filename which matched a suffix rule.

$?
The names of all the dependencies newer than the target separated by spaces.

$^
The names of all the dependencies separated by spaces, but with duplicate names removed.

$+
The names of all the dependencies separated by spaces with duplicate names included and in the same order as in the rule.

Some of these are only useful as part of suffix rules which are described in section 1.7.



Garrett
Fri Jan 24 17:04:25 EST 1997