]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/esd/adciop/Makefile
Add support for a saving build objects in a separate directory.
[karo-tx-uboot.git] / board / esd / adciop / Makefile
index 67cf29b3281b31d8e9fc41127db9144f8acf39ef..699a8488ea9dd438c53054d5bc94fd18bfe58e41 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2000
+# (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).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o ../common/pci.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o ../common/pci.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
@@ -39,9 +46,9 @@ distclean:    clean
 
 #########################################################################
 
-.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
 
 #########################################################################