xref: /openbmc/u-boot/arch/sh/lib/Makefile (revision c0dcece7)
1#
2# Copyright (c) 2007
3# Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
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
13SOBJS-y	+=
14GLSOBJS	+= ashiftrt.o
15GLSOBJS	+= ashiftlt.o
16GLSOBJS	+= lshiftrt.o
17GLSOBJS	+= ashldi3.o
18GLSOBJS	+= ashrsi3.o
19GLSOBJS	+= lshrdi3.o
20GLSOBJS	+= movmem.o
21
22COBJS-y	+= board.o
23COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
24ifeq ($(CONFIG_SH2),y)
25COBJS-y	+= time_sh2.o
26else
27COBJS-y	+= time.o
28endif
29ifeq ($(CONFIG_CMD_SH_ZIMAGEBOOT),y)
30COBJS-y += zimageboot.o
31endif
32
33SRCS	:= $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
34OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
35LGOBJS	:= $(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)
47
48$(LIB):	$(obj).depend $(OBJS)
49	$(call cmd_link_o_target, $(OBJS))
50
51$(LIBGCC): $(obj).depend $(LGOBJS)
52	$(call cmd_link_o_target, $(LGOBJS))
53
54#########################################################################
55
56# defines $(obj).depend target
57include $(SRCTREE)/rules.mk
58
59sinclude $(obj).depend
60
61#########################################################################
62