xref: /openbmc/u-boot/arch/x86/lib/Makefile (revision 6c9a1003)
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-$(CONFIG_EFI) += efi/
19obj-y	+= e820.o
20obj-y	+= gcc.o
21obj-y	+= init_helpers.o
22obj-y	+= interrupts.o
23obj-y	+= lpc-uclass.o
24obj-y	+= mpspec.o
25obj-$(CONFIG_ENABLE_MRC_CACHE) += mrccache.o
26obj-y += cmd_mtrr.o
27obj-y	+= northbridge-uclass.o
28obj-$(CONFIG_I8259_PIC) += i8259.o
29obj-$(CONFIG_I8254_TIMER) += i8254.o
30obj-y	+= pinctrl_ich6.o
31obj-y	+= pirq_routing.o
32obj-y	+= relocate.o
33obj-y += physmem.o
34obj-$(CONFIG_INTEL_MID) += pmu.o
35obj-$(CONFIG_X86_RAMTEST) += ramtest.o
36obj-$(CONFIG_INTEL_MID) += scu.o
37obj-y	+= sections.o
38obj-y += sfi.o
39obj-y	+= string.o
40ifndef CONFIG_QEMU
41obj-$(CONFIG_GENERATE_ACPI_TABLE) += acpi_table.o
42endif
43obj-y	+= tables.o
44ifndef CONFIG_SPL_BUILD
45obj-$(CONFIG_CMD_ZBOOT)	+= zimage.o
46endif
47obj-$(CONFIG_HAVE_FSP) += fsp/
48obj-$(CONFIG_SPL_BUILD) += spl.o
49
50extra-$(CONFIG_USE_PRIVATE_LIBGCC) += lib.a
51
52NORMAL_LIBGCC = $(shell $(CC) $(PLATFORM_CPPFLAGS) -print-libgcc-file-name)
53OBJCOPYFLAGS := --prefix-symbols=__normal_
54$(obj)/lib.a: $(NORMAL_LIBGCC) FORCE
55	$(call if_changed,objcopy)
56
57ifeq ($(CONFIG_$(SPL_)X86_64),)
58obj-$(CONFIG_EFI_APP) += crt0_ia32_efi.o reloc_ia32_efi.o
59endif
60
61ifneq ($(CONFIG_EFI_STUB),)
62
63CFLAGS_REMOVE_reloc_ia32_efi.o += -mregparm=3
64CFLAGS_reloc_ia32_efi.o += -fpic -fshort-wchar
65
66# When building for 64-bit we must remove the i386-specific flags
67CFLAGS_REMOVE_reloc_x86_64_efi.o += -mregparm=3 -march=i386 -m32
68CFLAGS_reloc_x86_64_efi.o += -fpic -fshort-wchar
69
70AFLAGS_REMOVE_crt0_x86_64_efi.o += -mregparm=3 -march=i386 -m32
71AFLAGS_crt0_x86_64_efi.o += -fpic -fshort-wchar
72
73extra-$(CONFIG_EFI_STUB_32BIT) += crt0_ia32_efi.o reloc_ia32_efi.o
74extra-$(CONFIG_EFI_STUB_64BIT) += crt0_x86_64_efi.o reloc_x86_64_efi.o
75
76endif
77
78ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
79ifeq ($(CONFIG_$(SPL_)X86_64),)
80extra-y += $(EFI_CRT0) $(EFI_RELOC)
81endif
82endif
83