OBJS
is a variable. The object files are what your compiler outputs for each compilation unit, and will be fed into the linker.
calc: $(OBJS)
gcc -o $@ $(OBJS) -ll
That line is telling Make to rebuild calc whenever any of the files in the $(OBJS)
variable change. $@
is a special Make variable that refers to the name of the target (in this case calc
).
What Make does is build a dependency graph of its targets. The targets come before the :
and the dependencies come after. If any target needs to be built (like the default calc
in the example) it will check all of its dependencies to see if any of them need to be rebuilt. Make uses the modification time to determine this; if a target is older than one of its dependencies, or the target doesn't exist, it needs rebuilding.