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