Makefile 2.2 KB
Newer Older
1 2 3 4 5 6 7 8
#
# arch/x86/realmode/Makefile
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.
#
#
9 10
KASAN_SANITIZE			:= n
OBJECT_FILES_NON_STANDARD	:= y
11

D
Dmitry Vyukov 已提交
12 13 14
# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
KCOV_INSTRUMENT		:= n

15
always := realmode.bin realmode.relocs
16 17 18 19 20 21 22 23 24 25

wakeup-objs	:= wakeup_asm.o wakemain.o video-mode.o
wakeup-objs	+= copy.o bioscall.o regs.o
# The link order of the video-*.o modules can matter.  In particular,
# video-vga.o *must* be listed first, followed by video-vesa.o.
# Hardware-specific drivers should follow in the order they should be
# probed, and video-bios.o should typically be last.
wakeup-objs	+= video-vga.o
wakeup-objs	+= video-vesa.o
wakeup-objs	+= video-bios.o
26

27 28 29
realmode-y			+= header.o
realmode-y			+= trampoline_$(BITS).o
realmode-y			+= stack.o
30
realmode-y			+= reboot.o
31 32
realmode-$(CONFIG_ACPI_SLEEP)	+= $(wakeup-objs)

33 34 35 36 37 38 39 40 41 42
targets	+= $(realmode-y)

REALMODE_OBJS = $(addprefix $(obj)/,$(realmode-y))

sed-pasyms := -n -r -e 's/^([0-9a-fA-F]+) [ABCDGRSTVW] (.+)$$/pa_\2 = \2;/p'

quiet_cmd_pasyms = PASYMS  $@
      cmd_pasyms = $(NM) $(filter-out FORCE,$^) | \
		   sed $(sed-pasyms) | sort | uniq > $@

43
targets += pasyms.h
44 45 46
$(obj)/pasyms.h: $(REALMODE_OBJS) FORCE
	$(call if_changed,pasyms)

47
targets += realmode.lds
48 49 50 51 52
$(obj)/realmode.lds: $(obj)/pasyms.h

LDFLAGS_realmode.elf := --emit-relocs -T
CPPFLAGS_realmode.lds += -P -C -I$(obj)

53
targets += realmode.elf
54 55 56 57 58
$(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE
	$(call if_changed,ld)

OBJCOPYFLAGS_realmode.bin := -O binary

59
targets += realmode.bin
60
$(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE
61
	$(call if_changed,objcopy)
62
	@:
63 64

quiet_cmd_relocs = RELOCS  $@
65
      cmd_relocs = arch/x86/tools/relocs --realmode $< > $@
66 67

targets += realmode.relocs
68 69 70 71 72
$(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
	$(call if_changed,relocs)

# ---------------------------------------------------------------------------

73 74
KBUILD_CFLAGS	:= $(LINUXINCLUDE) $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
		   -I$(srctree)/arch/x86/boot
75 76
KBUILD_AFLAGS	:= $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
77
UBSAN_SANITIZE := n