]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/netstal/hcu4/Makefile
Merge branch 'master' of git://git.denx.de/u-boot-samsung
[karo-tx-uboot.git] / board / netstal / hcu4 / Makefile
index 3d1d65d35ea9aa240fcf390fada809a15fd4fe05..a983de9f907900cb0cc97a4d3e55637b60d70cfc 100644 (file)
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = $(obj)lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).o
 
-# NOBJS : Netstal common objects
-NOBJS  = fixed_sdram.o hcu_flash.o nm_bsp.o
-COBJS  = $(BOARD).o
-SOBJS  =
+COBJS  = $(BOARD).o \
+       ../common/fixed_sdram.o \
+       ../common/nm_bsp.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c) $(addprefix ../common/,$(NOBJS:.o=.c))
+SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
-NOBJS  := $(addprefix $(obj)../common/,$(NOBJS))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(OBJS) $(SOBJS) $(NOBJS)
-       $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS) $(NOBJS)
+$(LIB):        $(OBJS)
+       $(call cmd_link_o_target, $^)
 
 clean:
-       rm -f $(SOBJS) $(OBJS)
+       rm -f $(OBJS)
 
 distclean:     clean
-       rm -f $(LIB) core *.bak .depend
+       rm -f $(LIB) core *.bak $(obj).depend
 
 #########################################################################