IGEPV2: Fixing Makefile to properly save objects in a different path
authorRicardo Salveti de Araujo <ricardo.salveti@canonical.com>
Wed, 26 Jan 2011 13:59:55 +0000 (19:29 +0530)
committerAnand Gadiyar <gadiyar@ti.com>
Wed, 26 Jan 2011 13:59:55 +0000 (19:29 +0530)
Now it follows the same as we have with other boards.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
board/igep0020/Makefile

index 8c45438..c9a4dad 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := igep0020.o 
+COBJS  := igep0020.o
 SOBJS  := platform.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
 
 distclean:     clean
-       rm -f $(LIB) core *.bak .depend
+       rm -f $(LIB) core *.bak $(obj).depend
 
 #########################################################################
 
-.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
 
 #########################################################################