#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
# (C) Copyright 2002 Wolfgang Grandegger <wg@denx.de>
#
# See file CREDITS for list of people who contributed to this
include $(TOPDIR)/config.mk
-LIB = lib$(BOARD).a
-
-OBJS := $(BOARD).o flash.o
+LIB = $(obj)lib$(BOARD).o
-$(LIB): $(OBJS) $(SOBJS)
- $(AR) crv $@ $^
+COBJS := $(BOARD).o flash.o
-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): $(obj).depend $(OBJS)
+ $(call cmd_link_o_target, $(OBJS))
#########################################################################
-.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
- $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
--include .depend
+sinclude $(obj).depend
#########################################################################