blob: f91406c06002cd31e064fc3d3ea5cc67132dafcd [file] [log] [blame]
wdenkbb1b8262003-03-27 12:09:35 +00001#
Marian Balakowiczd62379d2006-09-01 19:49:50 +02002# (C) Copyright 2003-2006
wdenkbb1b8262003-03-27 12:09:35 +00003# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005# SPDX-License-Identifier: GPL-2.0+
wdenkbb1b8262003-03-27 12:09:35 +00006#
7
8include $(TOPDIR)/config.mk
9
Sebastien Carliera8d426f2010-11-05 15:48:07 +010010LIB = $(obj)lib$(ARCH).o
wdenkbb1b8262003-03-27 12:09:35 +000011
Marek Vasut1954ce72012-08-12 16:53:35 +020012## Build a couple of necessary functions into a private libgcc
13LIBGCC = $(obj)libgcc.o
14GLSOBJS += ashldi3.o
15GLSOBJS += ashrdi3.o
16GLSOBJS += lshrdi3.o
17LGOBJS := $(addprefix $(obj),$(GLSOBJS))
18
Marian Balakowicz699ffe52008-02-27 11:00:47 +010019SOBJS-y +=
wdenkbb1b8262003-03-27 12:09:35 +000020
Marian Balakowicz699ffe52008-02-27 11:00:47 +010021COBJS-y += board.o
Dirk Eibachd2df8112013-06-26 15:55:16 +020022COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
wdenkbb1b8262003-03-27 12:09:35 +000023
Wolfgang Denka1be4762008-05-20 16:00:29 +020024SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
Marian Balakowicz699ffe52008-02-27 11:00:47 +010025OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
wdenkbb1b8262003-03-27 12:09:35 +000026
Marek Vasut1954ce72012-08-12 16:53:35 +020027# Always build libmips.o
28TARGETS := $(LIB)
29
30# Build private libgcc only when asked for
31ifdef USE_PRIVATE_LIBGCC
32TARGETS += $(LIBGCC)
33endif
34
35all: $(TARGETS)
36
Marian Balakowiczd62379d2006-09-01 19:49:50 +020037$(LIB): $(obj).depend $(OBJS)
Sebastien Carliera8d426f2010-11-05 15:48:07 +010038 $(call cmd_link_o_target, $(OBJS))
wdenkbb1b8262003-03-27 12:09:35 +000039
Marek Vasut1954ce72012-08-12 16:53:35 +020040$(LIBGCC): $(obj).depend $(LGOBJS)
41 $(call cmd_link_o_target, $(LGOBJS))
42
wdenkbb1b8262003-03-27 12:09:35 +000043#########################################################################
44
Marian Balakowiczd62379d2006-09-01 19:49:50 +020045# defines $(obj).depend target
46include $(SRCTREE)/rules.mk
wdenkbb1b8262003-03-27 12:09:35 +000047
Marian Balakowiczd62379d2006-09-01 19:49:50 +020048sinclude $(obj).depend
wdenkbb1b8262003-03-27 12:09:35 +000049
50#########################################################################