Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #
  2. # arch/x86/realmode/Makefile
  3. #
  4. # This file is subject to the terms and conditions of the GNU General Public
  5. # License. See the file "COPYING" in the main directory of this archive
  6. # for more details.
  7. #
  8. #
  9. always-y := realmode.bin realmode.relocs
  10. wakeup-objs := wakeup_asm.o wakemain.o video-mode.o
  11. wakeup-objs += copy.o bioscall.o regs.o
  12. # The link order of the video-*.o modules can matter. In particular,
  13. # video-vga.o *must* be listed first, followed by video-vesa.o.
  14. # Hardware-specific drivers should follow in the order they should be
  15. # probed, and video-bios.o should typically be last.
  16. wakeup-objs += video-vga.o
  17. wakeup-objs += video-vesa.o
  18. wakeup-objs += video-bios.o
  19. realmode-y += header.o
  20. realmode-y += trampoline_$(BITS).o
  21. realmode-y += stack.o
  22. realmode-y += reboot.o
  23. realmode-$(CONFIG_ACPI_SLEEP) += $(wakeup-objs)
  24. targets += $(realmode-y)
  25. REALMODE_OBJS = $(addprefix $(obj)/,$(realmode-y))
  26. sed-pasyms := -n -r -e 's/^([0-9a-fA-F]+) [ABCDGRSTVW] (.+)$$/pa_\2 = \2;/p'
  27. quiet_cmd_pasyms = PASYMS $@
  28. cmd_pasyms = $(NM) $(real-prereqs) | sed $(sed-pasyms) | sort | uniq > $@
  29. targets += pasyms.h
  30. $(obj)/pasyms.h: $(REALMODE_OBJS) FORCE
  31. $(call if_changed,pasyms)
  32. targets += realmode.lds
  33. $(obj)/realmode.lds: $(obj)/pasyms.h
  34. LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T
  35. CPPFLAGS_realmode.lds += -P -C -I$(objtree)/$(obj)
  36. targets += realmode.elf
  37. $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE
  38. $(call if_changed,ld)
  39. OBJCOPYFLAGS_realmode.bin := -O binary
  40. targets += realmode.bin
  41. $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE
  42. $(call if_changed,objcopy)
  43. quiet_cmd_relocs = RELOCS $@
  44. cmd_relocs = arch/x86/tools/relocs --realmode $< > $@
  45. targets += realmode.relocs
  46. $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
  47. $(call if_changed,relocs)
  48. # ---------------------------------------------------------------------------
  49. KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
  50. -I$(srctree)/arch/x86/boot
  51. KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
  52. KBUILD_CFLAGS += -fno-asynchronous-unwind-tables