https://medium.com/@laura.derohan/compiling-c-files-with-gcc-step-by-step-8e78318052

The steps#

1. The preprocessor#

  • it gets rid of all the comments in the source file(s)

  • it includes the code of the header file(s), which is a file with extension .h which contains C function declarations and macro definitions

  • it replaces all of the macros (fragments of code which have been given a name) by their values

gcc -E ./small.c

2. The compiler#

gcc -S ./small.c

3. The assembler#

gcc -c ./small.c

4. The linker#

gcc ./small.c -o ./small