]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/mpl/mip405/Makefile
punt unused clean/distclean targets
[karo-tx-uboot.git] / board / mpl / mip405 / Makefile
index 839cafe21391d9c14d75c4ac2e820232a5466af6..5dd0b2f8e5ad9cf3a1217a8e1ae01eb195005c1a 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 ../common/flash.o cmd_mip405.o ../common/pci.o \
-                       ../common/usb_uhci.o ../common/memtst.o ../common/common_util.o
+COBJS  = $(BOARD).o ../common/flash.o cmd_mip405.o ../common/pci.o \
+                       ../common/usb_uhci.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
 
 #########################################################################