is for just compiling .c files into .o (no linking).
will compile the code if needed and then link it together into the program.
You can give both .c files (that will be compiled) and .o files
(previously compiled) as input for the linking.
Note that the "-o prog" is optional. If you don't specify the name of the output program that is to be created, it will be named "a.out" by default.
I suggest you read up on Makefiles and the "make" command too.