If you want to specify which makefile to use you can do so using the
-f option.
If you rename the file as
makefile or
Makefile it should be able to find it automatically.
If you don't specify a target it will automatically choose the default target which is the first target in the makefile. By convention it should build the whole program and be named
all, exactly as you have it.
You also have three other targets
main.o,
Greetings.o and
main.
The
main.o target is the recipe for how to create the file main.o.
The
Greetings.o target is the recipe for how to create the file Greetings.o.
The
main target is the recipe for how to build the main file (the executable).
You can specify which target you want and it will only run the code for that target (and all prerequisite targets).
This will only execute ´g++ -c -Werror Greetings.cc´ but only if necessary. If Greetings.o already exist, and the files Greetings.cc and Greetings.h has not been modified since Greetings.o was last created, it will not run the compiler command.