Page 1 of 1

How to compile my kernel

Posted: Sat Feb 09, 2002 3:50 am
by Whatever5k
Hi,
ok, I have my kernel.c and some headerfiles in my own include directory... .
Do I only need to compile my kernel.c or also the headerfiles? And how do I manage, that the #include directory is not /usr/include?

Re: How to compile my kernel

Posted: Sat Feb 09, 2002 9:44 pm
by K.J.
Well, if you includes are in the same directory as your kernel.c then simply include them like this(notice the quotes):

#include "whatever.h"

That will make the compiler look for the includes in the directory that your kernel.c is in.

Do I only need to compile my kernel.c or also the headerfiles?

Both. If you just say:

gcc kernel.c
or more likly:
gcc -c kernel.c
(then link kernel.o to a flat binary)

The includes should be automaticly compiled into kernel.o so they should stay when you link kernel.o

K.J.