Generating a complete program

All in one go

gcc -myCfile.c -lmystuff.a will generate myCfile.o and link it to both our own library myStuff.a (to get myfunction.o) and the default standard C library. This results in an executable file a.out being created. Our header file would have to be in a standard place to be found by gcc.

Incremental steps
  gcc -c myCfile.c  -> generates myCfile.o
  gcc -c myfunction.c  -> generates myfunction.o
  gcc -o myProgram myCfile.o myfunction.o 
             -> generates myProgram executable