[Prev][Next][Index][Thread]

Re: Compiling OS KIt Kernles



>
> Levi wrote:
> > I can't grok makefiles. If someone could be so kind as to help me
> > with this, I'd really apreciate it.
>
> I wanted to avoid working in the oskit release directory, so in the
> examples directory I deleted a few .o files and executables and then
> tried 'make -n' on some judicious targets.  I managed to come up with
> the following sort of simplified makefile, and the examples I've looked
> at follow this same pattern.
>
> Mike
>
> oskitlib=/usr/local/lib/oskit
> oskitinc=-nostdinc -I. -I/usr/local/include -I/usr/local/include/oskit/c
>
> CFLAGS=-DOSKIT ${oskitinc} -O2 -Wall
> LDFLAGS=-Ttext 100000 -nostdlib -L/usr/local/lib
>
> zimage: pingreply
>         mklinuximage -o zimage pingreply
>
> pingreply: pingreply.o bootp.o dummy.o
>         ld ${LDFLAGS} -o pingreply \
>             ${oskitlib}/multiboot.o pingreply.o bootp.o dummy.o \
>             -loskit_bootp -loskit_linux_dev -loskit_dev -loskit_kern \
>             -loskit_c -loskit_lmm \
>             ${oskitlib}/crtn.o
>
> clean:
>         rm -f *.o pingreply zimage
>

I started to do it this way, too, for my OS, but then I found
i486-oskit-gcc in the flux bin directory. That takes care of your CFLAGS and
LDFLAGS for you, and also you don't need to explicitly link multiboot.o and
crtn.o into your kernel. Try it out...

-phil