The process of converting a
c program file to the executable form is called as '
build process'. These conversion takes many steps. The steps of build process could be expalined with the help of following figure,
C Program source Code File. Suppose a C program file (test.c)
Expanded source code of the c program file (test.i)
Generation of assembly code file (test.asm)
Relocatable Object Code With The object code of libraries file
The Final Executable Code File (test.exe)
So, we will see the build process steps in detail.
1) Editor : Type the source code in the editor like notepad, notepad ++.
2) Pre-Processing : The C program source is expanded as per the libraries included in the c program file (test.c). Here, note that we are assuming a c program with file named as (test.c). The file after expandation is named as (test.i)
3) Compilation : After the expandation of source code, the file (test.i) is then compiled into assembly language and is stored as an assembly file with an extension as '.asm' . Here the assumed file will be compiled and stored in assembly language as (test.asm).
4) Assembling : The assembler then translates the .asm file to the relocatable object code file as '.obj' and is one of the binary files.
5) Linking : The most important step of the build process were the executable file is created. The '.exe' file is created. Finding global variable, external function and combining data, code section.
6) Loading : Now the .exe file is created and stored on the disk and is ready for execution. The file is brought from the disk into memory (RAM) by 'program loader'. Program loader is an operating system component.