summaryrefslogtreecommitdiff
path: root/arch/mips/lib/Makefile
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2012-09-14 07:15:48 -0700
committerTom Rini <trini@ti.com>2012-09-14 07:15:48 -0700
commit8f082d78fafd94db3f21b503794e0875d3331e53 (patch)
tree1eef05dcd0fca58283eac2c5fff55ba53f5abc81 /arch/mips/lib/Makefile
parentf71d5cd56bee6e730fe46f5f2024f1b5106ab944 (diff)
parent748fd4a621a870d378e4e4f54df76a38fd5d3cba (diff)
Merge branch 'master' of git://git.denx.de/u-boot-mips
Diffstat (limited to 'arch/mips/lib/Makefile')
-rw-r--r--arch/mips/lib/Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile
index 9244f3151a..967e98a526 100644
--- a/arch/mips/lib/Makefile
+++ b/arch/mips/lib/Makefile
@@ -25,6 +25,13 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(ARCH).o
+## Build a couple of necessary functions into a private libgcc
+LIBGCC = $(obj)libgcc.o
+GLSOBJS += ashldi3.o
+GLSOBJS += ashrdi3.o
+GLSOBJS += lshrdi3.o
+LGOBJS := $(addprefix $(obj),$(GLSOBJS))
+
SOBJS-y +=
COBJS-y += board.o
@@ -37,9 +44,22 @@ endif
SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
+# Always build libmips.o
+TARGETS := $(LIB)
+
+# Build private libgcc only when asked for
+ifdef USE_PRIVATE_LIBGCC
+TARGETS += $(LIBGCC)
+endif
+
+all: $(TARGETS)
+
$(LIB): $(obj).depend $(OBJS)
$(call cmd_link_o_target, $(OBJS))
+$(LIBGCC): $(obj).depend $(LGOBJS)
+ $(call cmd_link_o_target, $(LGOBJS))
+
#########################################################################
# defines $(obj).depend target