next up previous
Next: A simple Makefile Up: What you need Previous: Making an executable

Compiler options

Various options can be given when the compiler is invoked:

When used in the various stages of the compiling, typical commands would be:

.c .o:
gcc -Wall -ansi -pedantic -g -I/home/john/include -o file1.o -c file1.c
The object file file1.o is created (with debug-information) from the sourcefile file1.c.

.o, .a a.out:
gcc -o myprog file1.o file2.o file3.o main.o -L/home/john/lib -lmylib -lm
From all objectfiles (file1.o, file2.o, file3.o and main.o) and some libraries (libmylib in /home/john/lib and libm) the executable named myprog is created.



Megens SA
Thu Jun 20 11:26:28 MET DST 1996