]> git.buserror.net Git - polintos/scott/priv.git/blob - kernel/arch/x86/Makefile.final
Move stdio defs to stdio.h, and fix an x86 makefile bug.
[polintos/scott/priv.git] / kernel / arch / x86 / Makefile.final
1 DIR := arch/x86/
2
3 $(BUILDDIR)/kernel: $(OBJS) $(LIBS) $(DIR)linker-script
4         @echo $(COMP): Linking kernel: $@
5         @$(MKDIR) $(dir $@)
6         @$(CXX) $(OBJS) $(LIBS) -lgcc -lsupc++ -nostdlib -o "$@" -Wl,-T$(DIR)linker-script
7
8 # GRUB refuses to use the addresses in the multiboot header if it
9 # finds a valid ELF header, so the dd hacks a zero into the high byte
10 # of the physical address field.  I tried using AT() in the linker
11 # script to properly generate separate physical and virtual
12 # addresses, but that caused the strip command to issue a warning and
13 # wipe out the BSS (setting memsz to filesz).
14
15 $(BUILDDIR)/kernel.stripped: $(BUILDDIR)/kernel
16         @echo $(COMP): Stripping kernel: $@
17         @$(STRIP) $(BUILDDIR)/kernel -o "$@"
18         @dd if=/dev/zero of=$(BUILDDIR)/kernel.stripped conv=notrunc \
19         bs=1 count=1 seek=67