Merge tag 'pci-v5.13-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[linux-2.6-microblaze.git] / arch / x86 / realmode / rm / Makefile
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
10 # Sanitizer runtimes are unavailable and cannot be linked here.
11 KASAN_SANITIZE                  := n
12 KCSAN_SANITIZE                  := n
13 OBJECT_FILES_NON_STANDARD       := y
14
15 # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
16 KCOV_INSTRUMENT         := n
17
18 always-y := realmode.bin realmode.relocs
19
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
29
30 realmode-y                      += header.o
31 realmode-y                      += trampoline_$(BITS).o
32 realmode-y                      += stack.o
33 realmode-y                      += reboot.o
34 realmode-$(CONFIG_ACPI_SLEEP)   += $(wakeup-objs)
35
36 targets += $(realmode-y)
37
38 REALMODE_OBJS = $(addprefix $(obj)/,$(realmode-y))
39
40 sed-pasyms := -n -r -e 's/^([0-9a-fA-F]+) [ABCDGRSTVW] (.+)$$/pa_\2 = \2;/p'
41
42 quiet_cmd_pasyms = PASYMS  $@
43       cmd_pasyms = $(NM) $(real-prereqs) | sed $(sed-pasyms) | sort | uniq > $@
44
45 targets += pasyms.h
46 $(obj)/pasyms.h: $(REALMODE_OBJS) FORCE
47         $(call if_changed,pasyms)
48
49 targets += realmode.lds
50 $(obj)/realmode.lds: $(obj)/pasyms.h
51
52 LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T
53 CPPFLAGS_realmode.lds += -P -C -I$(objtree)/$(obj)
54
55 targets += realmode.elf
56 $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE
57         $(call if_changed,ld)
58
59 OBJCOPYFLAGS_realmode.bin := -O binary
60
61 targets += realmode.bin
62 $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE
63         $(call if_changed,objcopy)
64
65 quiet_cmd_relocs = RELOCS  $@
66       cmd_relocs = arch/x86/tools/relocs --realmode $< > $@
67
68 targets += realmode.relocs
69 $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
70         $(call if_changed,relocs)
71
72 # ---------------------------------------------------------------------------
73
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
78 GCOV_PROFILE := n
79 UBSAN_SANITIZE := n