1b3266bd6SJarkko Sakkinen# 2b3266bd6SJarkko Sakkinen# arch/x86/realmode/Makefile 3b3266bd6SJarkko Sakkinen# 4b3266bd6SJarkko Sakkinen# This file is subject to the terms and conditions of the GNU General Public 5b3266bd6SJarkko Sakkinen# License. See the file "COPYING" in the main directory of this archive 6b3266bd6SJarkko Sakkinen# for more details. 7b3266bd6SJarkko Sakkinen# 8b3266bd6SJarkko Sakkinen# 940d04110SMarco Elver 105f2fb52fSMasahiro Yamadaalways-y := realmode.bin realmode.relocs 11c4845474SJarkko Sakkinen 12c4845474SJarkko Sakkinenwakeup-objs := wakeup_asm.o wakemain.o video-mode.o 13c4845474SJarkko Sakkinenwakeup-objs += copy.o bioscall.o regs.o 14c4845474SJarkko Sakkinen# The link order of the video-*.o modules can matter. In particular, 15c4845474SJarkko Sakkinen# video-vga.o *must* be listed first, followed by video-vesa.o. 16c4845474SJarkko Sakkinen# Hardware-specific drivers should follow in the order they should be 17c4845474SJarkko Sakkinen# probed, and video-bios.o should typically be last. 18c4845474SJarkko Sakkinenwakeup-objs += video-vga.o 19c4845474SJarkko Sakkinenwakeup-objs += video-vesa.o 20c4845474SJarkko Sakkinenwakeup-objs += video-bios.o 21b3266bd6SJarkko Sakkinen 220f6f11ebSH. Peter Anvinrealmode-y += header.o 230f6f11ebSH. Peter Anvinrealmode-y += trampoline_$(BITS).o 240f6f11ebSH. Peter Anvinrealmode-y += stack.o 2565051397SH. Peter Anvinrealmode-y += reboot.o 260f6f11ebSH. Peter Anvinrealmode-$(CONFIG_ACPI_SLEEP) += $(wakeup-objs) 270f6f11ebSH. Peter Anvin 28b3266bd6SJarkko Sakkinentargets += $(realmode-y) 29b3266bd6SJarkko Sakkinen 30b3266bd6SJarkko SakkinenREALMODE_OBJS = $(addprefix $(obj)/,$(realmode-y)) 31b3266bd6SJarkko Sakkinen 32b3266bd6SJarkko Sakkinensed-pasyms := -n -r -e 's/^([0-9a-fA-F]+) [ABCDGRSTVW] (.+)$$/pa_\2 = \2;/p' 33b3266bd6SJarkko Sakkinen 34b3266bd6SJarkko Sakkinenquiet_cmd_pasyms = PASYMS $@ 35afa974b7SMasahiro Yamada cmd_pasyms = $(NM) $(real-prereqs) | sed $(sed-pasyms) | sort | uniq > $@ 36b3266bd6SJarkko Sakkinen 370f6f11ebSH. Peter Anvintargets += pasyms.h 38b3266bd6SJarkko Sakkinen$(obj)/pasyms.h: $(REALMODE_OBJS) FORCE 39b3266bd6SJarkko Sakkinen $(call if_changed,pasyms) 40b3266bd6SJarkko Sakkinen 410f6f11ebSH. Peter Anvintargets += realmode.lds 42b3266bd6SJarkko Sakkinen$(obj)/realmode.lds: $(obj)/pasyms.h 43b3266bd6SJarkko Sakkinen 44927185c1SGeorge RimarLDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T 4558ab5e0cSArnd BergmannCPPFLAGS_realmode.lds += -P -C -I$(objtree)/$(obj) 46b3266bd6SJarkko Sakkinen 470f6f11ebSH. Peter Anvintargets += realmode.elf 48b3266bd6SJarkko Sakkinen$(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE 49b3266bd6SJarkko Sakkinen $(call if_changed,ld) 50b3266bd6SJarkko Sakkinen 51b3266bd6SJarkko SakkinenOBJCOPYFLAGS_realmode.bin := -O binary 52b3266bd6SJarkko Sakkinen 530f6f11ebSH. Peter Anvintargets += realmode.bin 54a9358bc3SPeter Foley$(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE 55b3266bd6SJarkko Sakkinen $(call if_changed,objcopy) 56b3266bd6SJarkko Sakkinen 57b3266bd6SJarkko Sakkinenquiet_cmd_relocs = RELOCS $@ 58f2604c14SJarkko Sakkinen cmd_relocs = arch/x86/tools/relocs --realmode $< > $@ 590f6f11ebSH. Peter Anvin 600f6f11ebSH. Peter Anvintargets += realmode.relocs 61b3266bd6SJarkko Sakkinen$(obj)/realmode.relocs: $(obj)/realmode.elf FORCE 62b3266bd6SJarkko Sakkinen $(call if_changed,relocs) 63b3266bd6SJarkko Sakkinen 64b3266bd6SJarkko Sakkinen# --------------------------------------------------------------------------- 65b3266bd6SJarkko Sakkinen 6606cbbac0SPaul BolleKBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \ 671c678da3SDavid Woodhouse -I$(srctree)/arch/x86/boot 68b3266bd6SJarkko SakkinenKBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ 69*003602adSArvind SankarKBUILD_CFLAGS += -fno-asynchronous-unwind-tables 70