]> git.sur5r.net Git - u-boot/blobdiff - board/mpl/pip405/Makefile
Merge branch 'master' of git://git.denx.de/u-boot-video
[u-boot] / board / mpl / pip405 / Makefile
index b6cc531bc9bee927084574f379a30a784ad4b651..9aebb9a71757cfbcbb23192adf24d40936e9e6e6 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).o
 
-OBJS   = $(BOARD).o \
+COBJS  = $(BOARD).o \
          ../common/flash.o cmd_pip405.o ../common/pci.o \
          ../common/isa.o ../common/kbd.o \
          ../common/usb_uhci.o \
-         ../common/memtst.o ../common/common_util.o
+         ../common/common_util.o
 
 SOBJS  = init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
-
-clean:
-       rm -f $(SOBJS) $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-distclean:     clean
-       rm -f $(LIB) core *.bak .depend
+$(LIB):        $(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
 
 #########################################################################