blob: 4e78723ea94a0cc3a7b00ac41baa6297e3100d66 [file] [log] [blame]
wdenkf47713f2002-09-08 19:49:36 +00001#
Marian Balakowiczd62379d2006-09-01 19:49:50 +02002# (C) Copyright 2002-2006
wdenkf47713f2002-09-08 19:49:36 +00003# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005# SPDX-License-Identifier: GPL-2.0+
wdenkf47713f2002-09-08 19:49:36 +00006#
7
8include $(TOPDIR)/config.mk
9
Sebastien Carliera8d426f2010-11-05 15:48:07 +010010LIB = $(obj)lib$(ARCH).o
11LIBGCC = $(obj)libgcc.o
wdenkf47713f2002-09-08 19:49:36 +000012
Wolfgang Denkc73f44d2009-07-23 13:15:59 +020013GLSOBJS += _ashldi3.o
14GLSOBJS += _ashrdi3.o
15GLSOBJS += _divsi3.o
Heiko Schocher8ffa25f2009-07-23 13:27:04 +020016GLSOBJS += _lshrdi3.o
Wolfgang Denkc73f44d2009-07-23 13:15:59 +020017GLSOBJS += _modsi3.o
18GLSOBJS += _udivsi3.o
19GLSOBJS += _umodsi3.o
20
21GLCOBJS += div0.o
wdenkf47713f2002-09-08 19:49:36 +000022
Albert ARIBAUDfacdae52013-01-08 10:18:02 +000023SOBJS-y += crt0.o
24
Allen Martinea74c932012-08-31 08:30:13 +000025ifndef CONFIG_SPL_BUILD
Albert ARIBAUD9580b322013-05-19 01:48:15 +000026SOBJS-y += relocate.o
Simon Glass97bbf182013-03-11 06:49:57 +000027ifndef CONFIG_SYS_GENERIC_BOARD
Marian Balakowicz699ffe52008-02-27 11:00:47 +010028COBJS-y += board.o
Simon Glass97bbf182013-03-11 06:49:57 +000029endif
Albert ARIBAUD800ea3e2013-06-11 14:17:32 +020030COBJS-y += sections.o
Simon Glass97bbf182013-03-11 06:49:57 +000031
Simon Glass653909f2013-05-08 08:06:03 +000032COBJS-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
Dirk Eibachd2df8112013-06-26 15:55:16 +020033COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
Aneesh V686a0752011-06-16 23:30:51 +000034COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
Matthias Weisser93416c12011-03-10 21:36:32 +000035SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
36SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
Tom Rini31dfba42012-08-22 15:31:05 -070037else
38COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
Aneesh V55fc5b62011-07-13 05:11:06 +000039endif
wdenkf47713f2002-09-08 19:49:36 +000040
Tom Wai-Hong Tamf1ffb6c2012-11-30 13:01:21 +000041COBJS-y += interrupts.o
42COBJS-y += reset.o
43
Stefano Babic84fb0dd2012-03-15 04:01:41 +000044COBJS-y += cache.o
45COBJS-y += cache-cp15.o
46
Wolfgang Denkc73f44d2009-07-23 13:15:59 +020047SRCS := $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
48 $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
Marian Balakowicz699ffe52008-02-27 11:00:47 +010049OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
Wolfgang Denkc73f44d2009-07-23 13:15:59 +020050LGOBJS := $(addprefix $(obj),$(GLSOBJS)) \
51 $(addprefix $(obj),$(GLCOBJS))
52
Sebastien Carliera8d426f2010-11-05 15:48:07 +010053# Always build libarm.o
Wolfgang Denkd47f4862009-08-17 13:17:29 +020054TARGETS := $(LIB)
55
56# Build private libgcc only when asked for
Wolfgang Denkc73f44d2009-07-23 13:15:59 +020057ifdef USE_PRIVATE_LIBGCC
Wolfgang Denkd47f4862009-08-17 13:17:29 +020058TARGETS += $(LIBGCC)
59endif
60
61# For EABI conformant tool chains, provide eabi_compat()
62ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
63TARGETS += $(obj)eabi_compat.o
Wolfgang Denkc73f44d2009-07-23 13:15:59 +020064endif
wdenkf47713f2002-09-08 19:49:36 +000065
Wolfgang Denkd47f4862009-08-17 13:17:29 +020066all: $(TARGETS)
67
Marian Balakowiczd62379d2006-09-01 19:49:50 +020068$(LIB): $(obj).depend $(OBJS)
Sebastien Carliera8d426f2010-11-05 15:48:07 +010069 $(call cmd_link_o_target, $(OBJS))
wdenkf47713f2002-09-08 19:49:36 +000070
Wolfgang Denkc73f44d2009-07-23 13:15:59 +020071$(LIBGCC): $(obj).depend $(LGOBJS)
Sebastien Carliera8d426f2010-11-05 15:48:07 +010072 $(call cmd_link_o_target, $(LGOBJS))
Wolfgang Denkc73f44d2009-07-23 13:15:59 +020073
wdenkf47713f2002-09-08 19:49:36 +000074#########################################################################
75
Marian Balakowiczd62379d2006-09-01 19:49:50 +020076# defines $(obj).depend target
77include $(SRCTREE)/rules.mk
wdenkf47713f2002-09-08 19:49:36 +000078
Marian Balakowiczd62379d2006-09-01 19:49:50 +020079sinclude $(obj).depend
wdenkf47713f2002-09-08 19:49:36 +000080
81#########################################################################