[Prev][Next][Index][Thread]
Re: Please HELP me!! :))
> I need a little help about how to write a Makefile for compiling
> sample kernels like hello.c... there is any example helpful to me??
Here is one of my test Makefiles. You should change the PATHs according
your system.
wagi
CLIB = -loskit_c
OSKITDIR = /home/wagi/hurd/build/oskit-20020317+pcmcia
CFLAGS = -I/home/wagi/hurd/build/oskit-20020317+pcmcia -I/home/wagi/hurd/oskit
-20020317+pcmcia -g
LDFLAGS = -static -L/home/wagi/hurd/build/oskit-20020317+pcmcia/lib
all: pcmcia_init
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
pcmcia_init: $(OSKITDIR)/lib/multiboot.o pcmcia_init.o
$(LD) -Ttext 100000 $(LDFLAGS) \
-o $@ $(filter-out %.a,$^) \
-loskit_startup \
-loskit_clientos \
-loskit_bootp \
-loskit_linux_pcmcia \
-loskit_linux_dev \
-loskit_dev \
-loskit_kern \
-loskit_lmm \
$(CLIB) $(OSKITDIR)/lib/crtn.o -loskit_kern
pcmcia_ping: $(OSKITDIR)/lib/multiboot.o pcmcia_ping.o bootp.o dummy.o
$(LD) -Ttext 100000 $(LDFLAGS) \
-o $@ $(filter-out %.a,$^) \
-loskit_startup -loskit_clientos -loskit_bootp \
-loskit_linux_dev -loskit_dev -loskit_kern -loskit_lmm \
-loskit_memdebug \
$(CLIB) $(OSKITDIR)/lib/crtn.o
list_devs: $(OSKITDIR)/lib/multiboot.o list_devs.o bootp.o dummy.o
$(LD) -Ttext 100000 $(LDFLAGS) \
-o $@ $(filter-out %.a,$^) \
-loskit_startup -loskit_clientos -loskit_bootp \
-loskit_linux_dev -loskit_dev -loskit_kern -loskit_lmm \
-loskit_memdebug \
$(CLIB) $(OSKITDIR)/lib/crtn.o
clean:
rm -f *.o pcmcia_init
References: