makefile:
$(TARGET): $(OBJ)
$(GCC) $(LDFLAGS) -o $@ $^
What $@
and $^
exactly do in make file?
makefile:
$(TARGET): $(OBJ)
$(GCC) $(LDFLAGS) -o $@ $^
What $@
and $^
exactly do in make file?
$^
is the set of dependent files used to build something else.
$@
is the name of the target to be built.
See http://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html
$@ is the name of the target. This is quite useful when the target is a pattern rather than fixed.
$^ is the name of the prerequisite that caused the rule to execute.