]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/bmw/Makefile
Switch from archive libraries to partial linking
[people/ms/u-boot.git] / board / bmw / Makefile
index 46fe7910e744cdb0696134c8a92df44296db3d08..4f88efafd462998cf32c0c78ac4865fa18948a15 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2002
 # James F. Dougherty, Broadcom Corporation, jfd@broadcom.com
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).o
 
-OBJS   = $(BOARD).o flash.o ns16550.o serial.o m48t59y.o
+COBJS  = $(BOARD).o flash.o ns16550.o serial.o m48t59y.o
 
 SOBJS  = early_init.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(call cmd_link_o_target, $(OBJS) $(SOBJS))
 
 #########################################################################
 
-.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
 
 #########################################################################