]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/sandburst/metrobox/Makefile
Switch from archive libraries to partial linking
[karo-tx-uboot.git] / board / sandburst / metrobox / Makefile
index 06a9a22b6ace0274e0fac8f59404ace1f4256fc5..e98c9895ef7078a524500bff040239819a88d234 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2005
 # Travis B. Sawyer, Sandburst Corporation, tsawyer@sandburst.com
 #
@@ -22,6 +25,9 @@
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
 # TBS: add for debugging purposes
 BUILDUSER := $(shell whoami)
@@ -31,27 +37,30 @@ CFLAGS += -DBUILDUSER='"$(BUILDUSER)"'
 # TBS: end debugging
 
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).o
 
-OBJS   = $(BOARD).o ../common/flash.o ../common/ppc440gx_i2c.o \
+COBJS  = $(BOARD).o ../common/flash.o ../common/ppc440gx_i2c.o \
        ../common/sb_common.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $(OBJS)
+       $(call cmd_link_o_target, $(OBJS))
 
 clean:
        rm -f $(SOBJS) $(OBJS)
 
 distclean:     clean
-       rm -f $(LIB) core *.bak .depend *~
+       rm -f $(LIB) core *.bak $(obj).depend
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################