blob: e9f82f711a5b462cfde61e3a67a95a8652e30071 [file] [log] [blame]
wdenkc0218802003-03-27 12:09:35 +00001#
Marian Balakowiczf9328632006-09-01 19:49:50 +02002# (C) Copyright 2003-2006
wdenkc0218802003-03-27 12:09:35 +00003# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
Wolfgang Denk1a459662013-07-08 09:37:19 +02005# SPDX-License-Identifier: GPL-2.0+
wdenkc0218802003-03-27 12:09:35 +00006#
7
8include $(TOPDIR)/config.mk
9
Sebastien Carlier6d8962e2010-11-05 15:48:07 +010010LIB = $(obj)lib$(ARCH).o
wdenkc0218802003-03-27 12:09:35 +000011
Marek Vasutd2aa5dc2012-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 Balakowicz823afe72008-02-27 11:00:47 +010019SOBJS-y +=
wdenkc0218802003-03-27 12:09:35 +000020
Marian Balakowicz823afe72008-02-27 11:00:47 +010021COBJS-y += board.o
Jean-Christophe PLAGNIOL-VILLARD1de1fa42008-09-08 20:54:39 +020022ifeq ($(CONFIG_QEMU_MIPS),y)
Dirk Eibachb8eee432013-06-26 15:55:16 +020023COBJS-$(CONFIG_CMD_BOOTM) += bootm_qemu_mips.o
Jean-Christophe PLAGNIOL-VILLARD1de1fa42008-09-08 20:54:39 +020024else
Dirk Eibachb8eee432013-06-26 15:55:16 +020025COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
Jean-Christophe PLAGNIOL-VILLARD1de1fa42008-09-08 20:54:39 +020026endif
wdenkc0218802003-03-27 12:09:35 +000027
Wolfgang Denk53677ef2008-05-20 16:00:29 +020028SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
Marian Balakowicz823afe72008-02-27 11:00:47 +010029OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
wdenkc0218802003-03-27 12:09:35 +000030
Marek Vasutd2aa5dc2012-08-12 16:53:35 +020031# Always build libmips.o
32TARGETS := $(LIB)
33
34# Build private libgcc only when asked for
35ifdef USE_PRIVATE_LIBGCC
36TARGETS += $(LIBGCC)
37endif
38
39all: $(TARGETS)
40
Marian Balakowiczf9328632006-09-01 19:49:50 +020041$(LIB): $(obj).depend $(OBJS)
Sebastien Carlier6d8962e2010-11-05 15:48:07 +010042 $(call cmd_link_o_target, $(OBJS))
wdenkc0218802003-03-27 12:09:35 +000043
Marek Vasutd2aa5dc2012-08-12 16:53:35 +020044$(LIBGCC): $(obj).depend $(LGOBJS)
45 $(call cmd_link_o_target, $(LGOBJS))
46
wdenkc0218802003-03-27 12:09:35 +000047#########################################################################
48
Marian Balakowiczf9328632006-09-01 19:49:50 +020049# defines $(obj).depend target
50include $(SRCTREE)/rules.mk
wdenkc0218802003-03-27 12:09:35 +000051
Marian Balakowiczf9328632006-09-01 19:49:50 +020052sinclude $(obj).depend
wdenkc0218802003-03-27 12:09:35 +000053
54#########################################################################