Merge branch 'master' of git://git.denx.de/u-boot-i2c
[oweals/u-boot.git] / board / bf533-ezkit / Makefile
index 8f51eb2f955244735d5c4053be97c280e8234e28..dfc1724eaebcfafeb58d931d65495d80e4e51b00 100644 (file)
@@ -1,7 +1,7 @@
 #
 # U-boot - Makefile
 #
-# Copyright (c) 2007 Analog Device Inc.
+# Copyright (c) 2005-2007 Analog Device Inc.
 #
 # (C) Copyright 2000-2006
 # 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
+COBJS-y        := $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS) u-boot.lds
-       $(AR) cr $@ $(OBJS)
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
 
-u-boot.lds: u-boot.lds.S
-       $(CPP) $(CPPFLAGS) -P -Ubfin $^ > $@.tmp
-       mv -f $@.tmp $@
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak $(obj).depend
 
 #########################################################################
 
-.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
 
 #########################################################################