]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/pcippc2/Makefile
Add support for a saving build objects in a separate directory.
[people/ms/u-boot.git] / board / pcippc2 / Makefile
index 2998f23eb06c5366087d924504a66c217736a840..2af328612a3d6cbd7cf8bf49a2d363183b5bb78e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 COBJS  = $(BOARD).o cpc710_pci.o flash.o sconsole.o \
          fpga_serial.o pcippc2_fpga.o cpc710_init_ram.o i2c.o
 
-AOBJS  =
+SOBJS  =
 
-OBJS   = $(COBJS) $(AOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        .depend $(OBJS)
-       $(AR) crv $@ $(OBJS)
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 #########################################################################
 
-.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-       $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################