1# SPDX-License-Identifier: GPL-2.0+
2#
3# (C) Copyright 2002-2006
4# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5
6ifndef CONFIG_X86_64
7ifndef CONFIG_TPL_BUILD
8obj-y += bios.o
9obj-y += bios_asm.o
10obj-y += bios_interrupts.o
11endif
12obj-y += string.o
13endif
14ifndef CONFIG_SPL_BUILD
15obj-$(CONFIG_CMD_BOOTM) += bootm.o
16endif
17obj-y	+= cmd_boot.o
18obj-$(CONFIG_SEABIOS) += coreboot_table.o
19obj-y	+= early_cmos.o
20obj-y	+= e820.o
21obj-y	+= init_helpers.o
22obj-y	+= interrupts.o
23obj-y	+= lpc-uclass.o
24obj-y	+= mpspec.o
25obj-$(CONFIG_$(SPL_TPL_)ACPIGEN) += acpi_nhlt.o
26obj-y	+= northbridge-uclass.o
27obj-$(CONFIG_I8259_PIC) += i8259.o
28obj-$(CONFIG_I8254_TIMER) += i8254.o
29obj-$(CONFIG_PINCTRL_ICH6) += pinctrl_ich6.o
30obj-y	+= pirq_routing.o
31obj-y	+= relocate.o
32obj-y += physmem.o
33obj-$(CONFIG_INTEL_MID) += pmu.o
34obj-$(CONFIG_X86_RAMTEST) += ramtest.o
35obj-$(CONFIG_INTEL_MID) += scu.o
36obj-y	+= sections.o
37obj-y += sfi.o
38obj-y	+= acpi.o
39obj-$(CONFIG_HAVE_ACPI_RESUME) += acpi_s3.o
40ifndef CONFIG_QEMU
41obj-y += acpigen.o
42obj-$(CONFIG_GENERATE_ACPI_TABLE) += acpi_table.o
43endif
44obj-y	+= tables.o
45ifndef CONFIG_SPL_BUILD
46obj-$(CONFIG_CMD_ZBOOT)	+= zimage.o
47endif
48obj-$(CONFIG_USE_HOB) += hob.o
49ifndef CONFIG_TPL_BUILD
50obj-$(CONFIG_ENABLE_MRC_CACHE) += mrccache.o
51obj-$(CONFIG_HAVE_FSP) += fsp/
52obj-$(CONFIG_FSP_VERSION1) += fsp1/
53obj-$(CONFIG_FSP_VERSION2) += fsp2/
54endif
55
56ifdef CONFIG_SPL_BUILD
57ifdef CONFIG_TPL_BUILD
58obj-y += tpl.o
59else
60obj-y += spl.o
61endif
62endif
63
64lib-$(CONFIG_USE_PRIVATE_LIBGCC) += div64.o
65
66ifeq ($(CONFIG_$(SPL_)X86_64),)
67obj-$(CONFIG_EFI_APP) += crt0_ia32_efi.o reloc_ia32_efi.o
68endif
69
70ifneq ($(CONFIG_EFI_STUB),)
71
72CFLAGS_REMOVE_reloc_ia32_efi.o += -mregparm=3
73CFLAGS_reloc_ia32_efi.o += -fpic -fshort-wchar
74
75# When building for 64-bit we must remove the i386-specific flags
76CFLAGS_REMOVE_reloc_x86_64_efi.o += -mregparm=3 -march=i386 -m32
77CFLAGS_reloc_x86_64_efi.o += -fpic -fshort-wchar -m64
78
79AFLAGS_REMOVE_crt0_x86_64_efi.o += -mregparm=3 -march=i386 -m32
80AFLAGS_crt0_x86_64_efi.o += -fpic -fshort-wchar -m64
81
82extra-$(CONFIG_EFI_STUB_32BIT) += crt0_ia32_efi.o reloc_ia32_efi.o
83extra-$(CONFIG_EFI_STUB_64BIT) += crt0_x86_64_efi.o reloc_x86_64_efi.o
84
85endif
86
87ifdef CONFIG_EFI_STUB
88
89ifeq ($(CONFIG_$(SPL_)X86_64),)
90extra-y += $(EFI_CRT0) $(EFI_RELOC)
91endif
92
93else
94
95ifndef CONFIG_SPL_BUILD
96ifneq ($(CONFIG_CMD_BOOTEFI_SELFTEST)$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
97extra-y += $(EFI_CRT0) $(EFI_RELOC)
98endif
99endif
100
101endif
102