compilers are programs that convert program source code to executable form
“executable” = machine code / bytecode
the Gnu C compiler: gcc
— three steps in the compiling process
gcc -o file1.c file2.c
#define
— outputs something similar to C (.e
file)gcc -E file.c > file.e
.o
file)gcc -c file.c
gcc -o file file1.o file2.o
note: dcc
and 3c
are ‘wrappers’ around gcc
for large projects, compilation gets complex:
need to run many commands (or long commands)
we don’t need to necessarily recompile every single file if we have only changed some
(only perform step 1 and step 2 on modified files → then link all the .o
files)
makefiles are usually named Makefile
and placed in same directory as everything else