Noob question. I want to compile bar.c with object file foo.o to an executable bar. I have this in a Makefile:
bar: foo.o
cc bar.c foo.o -o bar
I run $ make -n
and get :
cc -c -o foo.o foo.c
cc bar.c foo.o -o bar
I'm looking at the first line of output cc -c -o foo.o foo.c
. I didn't write an explicit rule compiling foo.c to foo.o. Does make
do this implicitly when it sees a .o target?