]> git.ipfire.org Git - people/ms/u-boot.git/blame - arch/arm/lib/Makefile
arm: Migrate SYS_THUMB_BUILD to Kconfig, introduce SPL_SYS_THUMB_BUILD
[people/ms/u-boot.git] / arch / arm / lib / Makefile
CommitLineData
f47713f3 1#
f9328639 2# (C) Copyright 2002-2006
f47713f3
WD
3# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
1a459660 5# SPDX-License-Identifier: GPL-2.0+
f47713f3
WD
6#
7
c5a543ea 8lib-$(CONFIG_USE_PRIVATE_LIBGCC) += ashldi3.o ashrdi3.o lshrdi3.o \
0bf65c64
MV
9 lib1funcs.o uldivmod.o div0.o \
10 div64.o muldi3.o
823afe7c 11
12d8a729 12ifdef CONFIG_CPU_V7M
13obj-y += vectors_m.o crt0.o
14else ifdef CONFIG_ARM64
0ae76531
DF
15obj-y += crt0_64.o
16else
41623c91 17obj-y += vectors.o crt0.o
0ae76531 18endif
e05e5de7 19
c497be78 20ifndef CONFIG_SPL_BUILD
0ae76531
DF
21ifdef CONFIG_ARM64
22obj-y += relocate_64.o
23else
24obj-y += relocate.o
25endif
959daa21 26
f99993c1 27obj-$(CONFIG_CPU_V7M) += cmd_boot.o
fa8f9508 28obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
5db28905 29obj-$(CONFIG_CMD_BOOTI) += bootm.o
fa8f9508 30obj-$(CONFIG_CMD_BOOTM) += bootm.o
5db28905 31obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
fa8f9508 32obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
6507f133 33else
fa8f9508 34obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
431889d6 35obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o
05bad4aa 36endif
40d5534c
TR
37obj-$(CONFIG_$(SPL_)USE_ARCH_MEMSET) += memset.o
38obj-$(CONFIG_$(SPL_)USE_ARCH_MEMCPY) += memcpy.o
261d2760 39obj-$(CONFIG_SEMIHOSTING) += semihosting.o
823afe7c 40
d0b5d9da 41obj-y += sections.o
68145d4c 42obj-y += stack.o
12d8a729 43ifdef CONFIG_CPU_V7M
44obj-y += interrupts_m.o
45else ifdef CONFIG_ARM64
3ffa95c2 46obj-y += ccn504.o
c71645ad 47obj-y += gic_64.o
0ae76531
DF
48obj-y += interrupts_64.o
49else
fa8f9508 50obj-y += interrupts.o
0ae76531 51endif
11636258 52ifndef CONFIG_SYSRESET
fa8f9508 53obj-y += reset.o
c6aabe92 54endif
52b1bf2c 55
fa8f9508 56obj-y += cache.o
0ae76531 57ifndef CONFIG_ARM64
fa8f9508 58obj-y += cache-cp15.o
0ae76531 59endif
f772acf8 60
45684ae3
HZ
61obj-y += psci-dt.o
62
51b17d49
MY
63obj-$(CONFIG_DEBUG_LL) += debug.o
64
f772acf8
WD
65# For EABI conformant tool chains, provide eabi_compat()
66ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
fa8f9508 67extra-y += eabi_compat.o
52b1bf2c 68endif
62e92077 69
c0db6f8d 70asflags-y += -DCONFIG_ARM_ASM_UNIFIED
c0db6f8d 71
62e92077
AA
72# some files can only build in ARM or THUMB2, not THUMB1
73
3a649407 74ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
c0db6f8d 75asflags-$(CONFIG_HAS_THUMB2) += -DCONFIG_THUMB2_KERNEL
62e92077
AA
76ifndef CONFIG_HAS_THUMB2
77
78# for C files, just apend -marm, which will override previous -mthumb*
79
ebda0cc5 80ifndef CONFIG_ARM64
62e92077
AA
81CFLAGS_cache.o := -marm
82CFLAGS_cache-cp15.o := -marm
ebda0cc5 83endif
62e92077
AA
84
85# For .S, drop -mthumb* and other thumb-related options.
86# CFLAGS_REMOVE_* would not have an effet, so AFLAGS_REMOVE_*
87# was implemented and is used here.
88# Also, define ${target}_NO_THUMB_BUILD for these two targets
89# so that the code knows it should not use Thumb.
90
91AFLAGS_REMOVE_memset.o := -mthumb -mthumb-interwork
92AFLAGS_REMOVE_memcpy.o := -mthumb -mthumb-interwork
93AFLAGS_memset.o := -DMEMSET_NO_THUMB_BUILD
94AFLAGS_memcpy.o := -DMEMCPY_NO_THUMB_BUILD
62e92077
AA
95endif
96endif
dd46eef2
SG
97
98# For building EFI apps
99CFLAGS_$(EFI_CRT0) := $(CFLAGS_EFI)
100CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI)
101
102CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI)
103CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI)
104
95b62b2e 105extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC)
dd46eef2 106extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC)