I am studying a Makefile obtained from a compiler course project. Only a part of it is pasted here.
# Retain intermediate bitcode files .PRECIOUS: %.bc # The default target builds the plugin plugin: make -C lib/p1 # create .bc from source %.bc: %.c clang -emit-llvm -O0 -c $*.c -o $*.bc # run printCode on a .bc file %.printCode: %.bc plugin opt -load Debug/lib/P1.so -printCode $*.bc
As you see, the target 'plugin' has no dependencies, which, if I understand correctly, should mean that its recipe never runs (unless it is declaared as a phony target, which is not the case here)
However, when I type 'make printCode', (printCode is the last target in the list) the plugin target does execute. How is this made possible? Is there some implicit rule stating that the first target of a Makefile is regarded as a phony target, such as 'all'?