xref: /openbmc/u-boot/arch/arm/lib/Makefile (revision 730d2544)
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
8lib-$(CONFIG_USE_PRIVATE_LIBGCC) += ashldi3.o ashrdi3.o lshrdi3.o \
9				    lib1funcs.o uldivmod.o div0.o \
10				    div64.o muldi3.o
11
12ifdef CONFIG_CPU_V7M
13obj-y	+= vectors_m.o crt0.o
14else ifdef CONFIG_ARM64
15obj-y	+= crt0_64.o
16else
17obj-y	+= vectors.o crt0.o
18endif
19
20ifndef CONFIG_SPL_BUILD
21ifdef CONFIG_ARM64
22obj-y	+= relocate_64.o
23else
24obj-y	+= relocate.o
25endif
26
27obj-$(CONFIG_CPU_V7M) += cmd_boot.o
28obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
29obj-$(CONFIG_CMD_BOOTI) += bootm.o
30obj-$(CONFIG_CMD_BOOTM) += bootm.o
31obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
32obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
33obj-$(CONFIG_USE_ARCH_MEMSET) += memset.o
34obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
35else
36obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
37obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o
38endif
39obj-$(CONFIG_SEMIHOSTING) += semihosting.o
40
41obj-y	+= sections.o
42obj-y	+= stack.o
43ifdef CONFIG_CPU_V7M
44obj-y	+= interrupts_m.o
45else ifdef CONFIG_ARM64
46obj-y	+= ccn504.o
47obj-y	+= gic_64.o
48obj-y	+= interrupts_64.o
49else
50obj-y	+= interrupts.o
51endif
52ifndef CONFIG_SYSRESET
53obj-y	+= reset.o
54endif
55
56obj-y	+= cache.o
57ifndef CONFIG_ARM64
58obj-y	+= cache-cp15.o
59endif
60
61obj-y	+= psci-dt.o
62
63obj-$(CONFIG_DEBUG_LL)	+= debug.o
64
65# For EABI conformant tool chains, provide eabi_compat()
66ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
67extra-y	+= eabi_compat.o
68endif
69
70asflags-y += -DCONFIG_ARM_ASM_UNIFIED
71
72# some files can only build in ARM or THUMB2, not THUMB1
73
74ifdef CONFIG_SYS_THUMB_BUILD
75asflags-$(CONFIG_HAS_THUMB2) += -DCONFIG_THUMB2_KERNEL
76ifndef CONFIG_HAS_THUMB2
77
78# for C files, just apend -marm, which will override previous -mthumb*
79
80CFLAGS_cache.o := -marm
81CFLAGS_cache-cp15.o := -marm
82
83# For .S, drop -mthumb* and other thumb-related options.
84# CFLAGS_REMOVE_* would not have an effet, so AFLAGS_REMOVE_*
85# was implemented and is used here.
86# Also, define ${target}_NO_THUMB_BUILD for these two targets
87# so that the code knows it should not use Thumb.
88
89AFLAGS_REMOVE_memset.o := -mthumb -mthumb-interwork
90AFLAGS_REMOVE_memcpy.o := -mthumb -mthumb-interwork
91AFLAGS_memset.o := -DMEMSET_NO_THUMB_BUILD
92AFLAGS_memcpy.o := -DMEMCPY_NO_THUMB_BUILD
93endif
94endif
95
96# For building EFI apps
97CFLAGS_$(EFI_CRT0) := $(CFLAGS_EFI)
98CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI)
99
100CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI)
101CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI)
102
103extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC)
104extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC)
105