I was using a Makefile from the book "Advanced Linux Programming (2001)" [code]. It was strange for me to see that GNU make does compile the code correctly, without even specifying a compiler in the Makefile. It's like baking without any recipe!
This is a minimal version of the code:
and make really works! This is the command it executes:
cc test.c -o test
I couldn't find anything useful in the documentation. How this is possible?
P.S. One additional note: Even the language is not specified; Because
test.c is available, GNU
cc. If there exists
test.cc (when there is no
test.c), it uses
g++ (and not