]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - lib_arm/Makefile
Make linking against libgcc configurable
[karo-tx-uboot.git] / lib_arm / Makefile
index 4469361a8aca1a21ab541579fc251d330fd93f78..241782c177a3164bbef5d44a49cfef19976530de 100644 (file)
 include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(ARCH).a
+LIBGCC = $(obj)libgcc.a
 
-SOBJS-y        += _ashldi3.o
-SOBJS-y        += _ashrdi3.o
-SOBJS-y        += _divsi3.o
-SOBJS-y        += _modsi3.o
-SOBJS-y        += _udivsi3.o
-SOBJS-y        += _umodsi3.o
+GLSOBJS        += _ashldi3.o
+GLSOBJS        += _ashrdi3.o
+GLSOBJS        += _divsi3.o
+GLSOBJS        += _modsi3.o
+GLSOBJS        += _udivsi3.o
+GLSOBJS        += _umodsi3.o
+
+GLCOBJS        += div0.o
 
 COBJS-y        += board.o
 COBJS-y        += bootm.o
@@ -38,16 +41,27 @@ COBJS-y     += cache.o
 ifndef CONFIG_SYS_NO_CP15_CACHE
 COBJS-y        += cache-cp15.o
 endif
-COBJS-y        += div0.o
 COBJS-y        += interrupts.o
 COBJS-y        += reset.o
 
-SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+SRCS   := $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
+          $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
+LGOBJS := $(addprefix $(obj),$(GLSOBJS)) \
+          $(addprefix $(obj),$(GLCOBJS))
+
+ifdef USE_PRIVATE_LIBGCC
+all:   $(LIB) $(LIBGCC)
+else
+all:   $(LIB)
+endif
 
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
 
+$(LIBGCC): $(obj).depend $(LGOBJS)
+       $(AR) $(ARFLAGS) $@ $(LGOBJS)
+
 #########################################################################
 
 # defines $(obj).depend target