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