Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. KASAN_SANITIZE := n
  10. always := realmode.bin realmode.relocs
  11. wakeup-objs := wakeup_asm.o wakemain.o video-mode.o
  12. wakeup-objs += copy.o bioscall.o regs.o
  13. # The link order of the video-*.o modules can matter. In particular,
  14. # video-vga.o *must* be listed first, followed by video-vesa.o.
  15. # Hardware-specific drivers should follow in the order they should be
  16. # probed, and video-bios.o should typically be last.
  17. wakeup-objs += video-vga.o
  18. wakeup-objs += video-vesa.o
  19. wakeup-objs += video-bios.o
  20. realmode-y += header.o
  21. realmode-y += trampoline_$(BITS).o
  22. realmode-y += stack.o
  23. realmode-y += reboot.o
  24. realmode-$(CONFIG_ACPI_SLEEP) += $(wakeup-objs)
  25. targets += $(realmode-y)
  26. REALMODE_OBJS = $(addprefix $(obj)/,$(realmode-y))
  27. sed-pasyms := -n -r -e 's/^([0-9a-fA-F]+) [ABCDGRSTVW] (.+)$$/pa_\2 = \2;/p'
  28. quiet_cmd_pasyms = PASYMS $@
  29. cmd_pasyms = $(NM) $(filter-out FORCE,$^) | \
  30. sed $(sed-pasyms) | sort | uniq > $@
  31. targets += pasyms.h
  32. $(obj)/pasyms.h: $(REALMODE_OBJS) FORCE
  33. $(call if_changed,pasyms)
  34. targets += realmode.lds
  35. $(obj)/realmode.lds: $(obj)/pasyms.h
  36. LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T
  37. CPPFLAGS_realmode.lds += -P -C -I$(obj)
  38. targets += realmode.elf
  39. $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE
  40. $(call if_changed,ld)
  41. OBJCOPYFLAGS_realmode.bin := -O binary
  42. targets += realmode.bin
  43. $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE
  44. $(call if_changed,objcopy)
  45. @:
  46. quiet_cmd_relocs = RELOCS $@
  47. cmd_relocs = arch/x86/tools/relocs --realmode $< > $@
  48. targets += realmode.relocs
  49. $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
  50. $(call if_changed,relocs)
  51. # ---------------------------------------------------------------------------
  52. KBUILD_CFLAGS := $(LINUXINCLUDE) $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
  53. -I$(srctree)/arch/x86/boot
  54. KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
  55. GCOV_PROFILE := n