xref: /openbmc/u-boot/arch/x86/lib/Makefile (revision 089df18b)
1#
2# (C) Copyright 2002-2006
3# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
5# SPDX-License-Identifier:	GPL-2.0+
6#
7
8ifndef CONFIG_X86_64
9obj-y += bios.o
10obj-y += bios_asm.o
11obj-y += bios_interrupts.o
12endif
13ifndef CONFIG_SPL_BUILD
14obj-$(CONFIG_CMD_BOOTM) += bootm.o
15endif
16obj-y	+= cmd_boot.o
17obj-$(CONFIG_SEABIOS) += coreboot_table.o
18obj-y	+= early_cmos.o
19obj-$(CONFIG_EFI) += efi/
20obj-y	+= e820.o
21obj-y	+= gcc.o
22obj-y	+= init_helpers.o
23obj-y	+= interrupts.o
24obj-y	+= lpc-uclass.o
25obj-y	+= mpspec.o
26obj-$(CONFIG_ENABLE_MRC_CACHE) += mrccache.o
27obj-y += cmd_mtrr.o
28obj-y	+= northbridge-uclass.o
29obj-$(CONFIG_I8259_PIC) += i8259.o
30obj-$(CONFIG_I8254_TIMER) += i8254.o
31obj-y	+= pinctrl_ich6.o
32obj-y	+= pirq_routing.o
33obj-y	+= relocate.o
34obj-y += physmem.o
35obj-$(CONFIG_INTEL_MID) += pmu.o
36obj-$(CONFIG_X86_RAMTEST) += ramtest.o
37obj-$(CONFIG_INTEL_MID) += scu.o
38obj-y	+= sections.o
39obj-y += sfi.o
40obj-y	+= string.o
41obj-$(CONFIG_HAVE_ACPI_RESUME) += acpi_s3.o
42ifndef CONFIG_QEMU
43obj-$(CONFIG_GENERATE_ACPI_TABLE) += acpi_table.o
44endif
45obj-y	+= tables.o
46ifndef CONFIG_SPL_BUILD
47obj-$(CONFIG_CMD_ZBOOT)	+= zimage.o
48endif
49obj-$(CONFIG_HAVE_FSP) += fsp/
50obj-$(CONFIG_SPL_BUILD) += spl.o
51
52extra-$(CONFIG_USE_PRIVATE_LIBGCC) += lib.a
53
54NORMAL_LIBGCC = $(shell $(CC) $(PLATFORM_CPPFLAGS) -print-libgcc-file-name)
55OBJCOPYFLAGS := --prefix-symbols=__normal_
56$(obj)/lib.a: $(NORMAL_LIBGCC) FORCE
57	$(call if_changed,objcopy)
58
59ifeq ($(CONFIG_$(SPL_)X86_64),)
60obj-$(CONFIG_EFI_APP) += crt0_ia32_efi.o reloc_ia32_efi.o
61endif
62
63ifneq ($(CONFIG_EFI_STUB),)
64
65CFLAGS_REMOVE_reloc_ia32_efi.o += -mregparm=3
66CFLAGS_reloc_ia32_efi.o += -fpic -fshort-wchar
67
68# When building for 64-bit we must remove the i386-specific flags
69CFLAGS_REMOVE_reloc_x86_64_efi.o += -mregparm=3 -march=i386 -m32
70CFLAGS_reloc_x86_64_efi.o += -fpic -fshort-wchar
71
72AFLAGS_REMOVE_crt0_x86_64_efi.o += -mregparm=3 -march=i386 -m32
73AFLAGS_crt0_x86_64_efi.o += -fpic -fshort-wchar
74
75extra-$(CONFIG_EFI_STUB_32BIT) += crt0_ia32_efi.o reloc_ia32_efi.o
76extra-$(CONFIG_EFI_STUB_64BIT) += crt0_x86_64_efi.o reloc_x86_64_efi.o
77
78endif
79
80ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
81ifeq ($(CONFIG_$(SPL_)X86_64),)
82extra-y += $(EFI_CRT0) $(EFI_RELOC)
83endif
84endif
85