What do $@ and $< in a makefile mean

make

I am seeing a makefile and it has the symbols $@ and $< in it. I have never seen them, and Google does not show any results about them. Do you know what these commands do?

Best Answer

From make manpage:

$@ is:

The file name of the target of the rule. If the target is an archive member, then ‘$@’ is the name of the archive file. In a pattern rule that has multiple targets (see Introduction to Pattern Rules), ‘$@’ is the name of whichever target caused the rule's recipe to be run.

$< is:

The name of the first prerequisite. If the target got its recipe from an implicit rule, this will be the first prerequisite added by the implicit rule.

You can see complete manual here.

Related Question