2 # arch/x86/realmode/Makefile
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
10 # Sanitizer runtimes are unavailable and cannot be linked here.
13 OBJECT_FILES_NON_STANDARD
:= y
15 # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
18 always-y
:= realmode.bin realmode.relocs
20 wakeup-objs
:= wakeup_asm.o wakemain.o video-mode.o
21 wakeup-objs
+= copy.o bioscall.o regs.o
22 # The link order of the video-*.o modules can matter. In particular,
23 # video-vga.o *must* be listed first, followed by video-vesa.o.
24 # Hardware-specific drivers should follow in the order they should be
25 # probed, and video-bios.o should typically be last.
26 wakeup-objs
+= video-vga.o
27 wakeup-objs
+= video-vesa.o
28 wakeup-objs
+= video-bios.o
30 realmode-y
+= header.o
31 realmode-y
+= trampoline_
$(BITS
).o
33 realmode-y
+= reboot.o
34 realmode-
$(CONFIG_ACPI_SLEEP
) += $(wakeup-objs
)
36 targets
+= $(realmode-y
)
38 REALMODE_OBJS
= $(addprefix $(obj
)/,$(realmode-y
))
40 sed-pasyms
:= -n
-r
-e
's/^([0-9a-fA-F]+) [ABCDGRSTVW] (.+)$$/pa_\2 = \2;/p'
42 quiet_cmd_pasyms
= PASYMS
$@
43 cmd_pasyms
= $(NM
) $(real-prereqs
) | sed
$(sed-pasyms
) |
sort | uniq
> $@
46 $(obj
)/pasyms.h
: $(REALMODE_OBJS
) FORCE
47 $(call if_changed
,pasyms
)
49 targets
+= realmode.lds
50 $(obj
)/realmode.lds
: $(obj
)/pasyms.h
52 LDFLAGS_realmode.elf
:= -m elf_i386
--emit-relocs
-T
53 CPPFLAGS_realmode.lds
+= -P
-C
-I
$(objtree
)/$(obj
)
55 targets
+= realmode.elf
56 $(obj
)/realmode.elf
: $(obj
)/realmode.lds
$(REALMODE_OBJS
) FORCE
59 OBJCOPYFLAGS_realmode.bin
:= -O binary
61 targets
+= realmode.bin
62 $(obj
)/realmode.bin
: $(obj
)/realmode.elf
$(obj
)/realmode.relocs FORCE
63 $(call if_changed
,objcopy
)
65 quiet_cmd_relocs
= RELOCS
$@
66 cmd_relocs
= arch
/x86
/tools
/relocs
--realmode
$< > $@
68 targets
+= realmode.relocs
69 $(obj
)/realmode.relocs
: $(obj
)/realmode.elf FORCE
70 $(call if_changed
,relocs
)
72 # ---------------------------------------------------------------------------
74 KBUILD_CFLAGS
:= $(REALMODE_CFLAGS
) -D_SETUP
-D_WAKEUP \
75 -I
$(srctree
)/arch
/x86
/boot
76 KBUILD_AFLAGS
:= $(KBUILD_CFLAGS
) -D__ASSEMBLY__
77 KBUILD_CFLAGS
+= -fno-asynchronous-unwind-tables