Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #
  2. # arch/x86/kernel/acpi/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. always := wakeup.bin
  9. targets := wakeup.elf wakeup.lds
  10. wakeup-y += wakeup.o wakemain.o video-mode.o copy.o bioscall.o regs.o
  11. # The link order of the video-*.o modules can matter. In particular,
  12. # video-vga.o *must* be listed first, followed by video-vesa.o.
  13. # Hardware-specific drivers should follow in the order they should be
  14. # probed, and video-bios.o should typically be last.
  15. wakeup-y += video-vga.o
  16. wakeup-y += video-vesa.o
  17. wakeup-y += video-bios.o
  18. targets += $(wakeup-y)
  19. bootsrc := $(src)/../../../boot
  20. # ---------------------------------------------------------------------------
  21. # How to compile the 16-bit code. Note we always compile for -march=i386,
  22. # that way we can complain to the user if the CPU is insufficient.
  23. # Compile with _SETUP since this is similar to the boot-time setup code.
  24. KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D_WAKEUP -D__KERNEL__ \
  25. -I$(srctree)/$(bootsrc) \
  26. $(cflags-y) \
  27. -Wall -Wstrict-prototypes \
  28. -march=i386 -mregparm=3 \
  29. -include $(srctree)/$(bootsrc)/code16gcc.h \
  30. -fno-strict-aliasing -fomit-frame-pointer \
  31. $(call cc-option, -ffreestanding) \
  32. $(call cc-option, -fno-toplevel-reorder,\
  33. $(call cc-option, -fno-unit-at-a-time)) \
  34. $(call cc-option, -fno-stack-protector) \
  35. $(call cc-option, -mpreferred-stack-boundary=2)
  36. KBUILD_CFLAGS += $(call cc-option, -m32)
  37. KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
  38. GCOV_PROFILE := n
  39. WAKEUP_OBJS = $(addprefix $(obj)/,$(wakeup-y))
  40. LDFLAGS_wakeup.elf := -T
  41. CPPFLAGS_wakeup.lds += -P -C
  42. $(obj)/wakeup.elf: $(obj)/wakeup.lds $(WAKEUP_OBJS) FORCE
  43. $(call if_changed,ld)
  44. OBJCOPYFLAGS_wakeup.bin := -O binary
  45. $(obj)/wakeup.bin: $(obj)/wakeup.elf FORCE
  46. $(call if_changed,objcopy)