xref: /openbmc/u-boot/arch/arm/lib/Makefile (revision 3765b3e7)
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
8include $(TOPDIR)/config.mk
9
10LIB	= $(obj)lib$(ARCH).o
11LIBGCC	= $(obj)libgcc.o
12
13GLSOBJS	+= _ashldi3.o
14GLSOBJS	+= _ashrdi3.o
15GLSOBJS	+= _divsi3.o
16GLSOBJS	+= _lshrdi3.o
17GLSOBJS	+= _modsi3.o
18GLSOBJS	+= _udivsi3.o
19GLSOBJS	+= _umodsi3.o
20
21GLCOBJS	+= div0.o
22
23SOBJS-y += crt0.o
24
25ifndef CONFIG_SPL_BUILD
26SOBJS-y += relocate.o
27ifndef CONFIG_SYS_GENERIC_BOARD
28COBJS-y	+= board.o
29endif
30COBJS-y += sections.o
31
32COBJS-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
33COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
34COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
35SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
36SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
37else
38COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
39endif
40
41COBJS-y	+= interrupts.o
42COBJS-y	+= reset.o
43
44COBJS-y	+= cache.o
45COBJS-y	+= cache-cp15.o
46
47SRCS	:= $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
48	   $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
49OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
50LGOBJS	:= $(addprefix $(obj),$(GLSOBJS)) \
51	   $(addprefix $(obj),$(GLCOBJS))
52
53# Always build libarm.o
54TARGETS	:= $(LIB)
55
56# Build private libgcc only when asked for
57ifdef USE_PRIVATE_LIBGCC
58TARGETS	+= $(LIBGCC)
59endif
60
61# For EABI conformant tool chains, provide eabi_compat()
62ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
63TARGETS	+= $(obj)eabi_compat.o
64endif
65
66all:	$(TARGETS)
67
68$(LIB):	$(obj).depend $(OBJS)
69	$(call cmd_link_o_target, $(OBJS))
70
71$(LIBGCC): $(obj).depend $(LGOBJS)
72	$(call cmd_link_o_target, $(LGOBJS))
73
74#########################################################################
75
76# defines $(obj).depend target
77include $(SRCTREE)/rules.mk
78
79sinclude $(obj).depend
80
81#########################################################################
82