8

What do the following characters means in a Makefile?

$@ , $? , $* , $< , $^

I have seen some explanations but i did not fully get how to exactly use it.

  • Possible duplicate of [What do the makefile symbols $@ and $< mean?](http://stackoverflow.com/questions/3220277/what-do-the-makefile-symbols-and-mean) – mike510a Dec 26 '16 at 11:13

1 Answers1

11

Using patterns and special variables

When wildcard % appears in the dependency list, it is replaced with 
the same string that was used to perform substitution in the target.

Inside actions we can use:  
    $@ to represent the full target name of the current target  
    $? returns the dependencies that are newer than the current target  
    $* returns the text that corresponds to % in the target     
    $< returns the name of the first dependency 
    $^ returns the names of all the dependencies with space as the delimiter

For further explanation, please see This github link

Amjad
  • 3,110
  • 2
  • 20
  • 19