Makefile 1.9 KB

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