blob: 8165963ee8dec37ae469f5ec82807ee90c224a82 [file] [log] [blame]
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +09001#
2# Copyright (c) 2007
3# Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4#
Wolfgang Denk1a459662013-07-08 09:37:19 +02005# SPDX-License-Identifier: GPL-2.0+
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +09006#
7
8include $(TOPDIR)/config.mk
9
Sebastien Carlier6d8962e2010-11-05 15:48:07 +010010LIB = $(obj)lib$(ARCH).o
Phil Edworthyeeb84df2011-06-02 22:15:27 +000011LIBGCC = $(obj)libgcc.o
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +090012
Marian Balakowicz823afe72008-02-27 11:00:47 +010013SOBJS-y +=
Phil Edworthyeeb84df2011-06-02 22:15:27 +000014GLSOBJS += ashiftrt.o
15GLSOBJS += ashiftlt.o
16GLSOBJS += lshiftrt.o
17GLSOBJS += ashldi3.o
Phil Edworthycb4046c2011-10-24 10:24:12 +010018GLSOBJS += ashrsi3.o
Phil Edworthyeeb84df2011-06-02 22:15:27 +000019GLSOBJS += lshrdi3.o
20GLSOBJS += movmem.o
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +090021
Marian Balakowicz823afe72008-02-27 11:00:47 +010022COBJS-y += board.o
Dirk Eibachb8eee432013-06-26 15:55:16 +020023COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
Nobuhiro Iwamatsue9d5f352008-11-20 16:44:42 +090024ifeq ($(CONFIG_SH2),y)
25COBJS-y += time_sh2.o
26else
27COBJS-y += time.o
28endif
Nobuhiro Iwamatsu45ce6f92010-12-08 13:49:12 +090029ifeq ($(CONFIG_CMD_SH_ZIMAGEBOOT),y)
30COBJS-y += zimageboot.o
31endif
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +090032
Wolfgang Denk53677ef2008-05-20 16:00:29 +020033SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
Marian Balakowicz823afe72008-02-27 11:00:47 +010034OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
Phil Edworthyeeb84df2011-06-02 22:15:27 +000035LGOBJS := $(addprefix $(obj),$(GLSOBJS)) \
36 $(addprefix $(obj),$(GLCOBJS))
37
38# Always build libsh.o
39TARGETS := $(LIB)
40
41# Build private libgcc only when asked for
42ifdef USE_PRIVATE_LIBGCC
43TARGETS += $(LIBGCC)
44endif
45
46all: $(TARGETS)
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +090047
48$(LIB): $(obj).depend $(OBJS)
Sebastien Carlier6d8962e2010-11-05 15:48:07 +010049 $(call cmd_link_o_target, $(OBJS))
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +090050
Phil Edworthyeeb84df2011-06-02 22:15:27 +000051$(LIBGCC): $(obj).depend $(LGOBJS)
52 $(call cmd_link_o_target, $(LGOBJS))
53
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +090054#########################################################################
55
56# defines $(obj).depend target
57include $(SRCTREE)/rules.mk
58
59sinclude $(obj).depend
60
61#########################################################################