Makefile 2.2 KB

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