hcu4, hcu5: fix out of tree building
authorWolfgang Denk <wd@denx.de>
Sun, 24 Oct 2010 14:49:12 +0000 (16:49 +0200)
committerWolfgang Denk <wd@denx.de>
Sun, 24 Oct 2010 14:49:12 +0000 (16:49 +0200)
Out of tree building of the Netstal hcu4 and hcu5 boards failed like
that:

Assembler messages:
Fatal error: can't create /work/wd/tmp-ppc/board/netstal/hcu4/../common/fixed_sdram.o: No such file or directory
Assembler messages:
Fatal error: can't create /work/wd/tmp-ppc/board/netstal/hcu4/../common/nm_bsp.o: No such file or directory
make[1]: *** [/work/wd/tmp-ppc/board/netstal/hcu4/../common/fixed_sdram.o] Error 2

Adapt (and simplify) the respective Makefiles.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Niklaus Giger <niklaus.giger@netstal.com>
board/netstal/hcu4/Makefile
board/netstal/hcu5/Makefile

index 6722d53..cd62642 100644 (file)
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
 LIB    = $(obj)lib$(BOARD).a
 
-# NOBJS : Netstal common objects
-NOBJS  = fixed_sdram.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)
+       $(AR) $(ARFLAGS) $@ $^
 
 clean:
-       rm -f $(SOBJS) $(OBJS)
+       rm -f $(OBJS)
 
 distclean:     clean
        rm -f $(LIB) core *.bak $(obj).depend
index 4456771..d037552 100644 (file)
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
 LIB    = $(obj)lib$(BOARD).a
 
-
-# NOBJS : Netstal common objects
-NOBJS  = nm_bsp.o
-COBJS  = $(BOARD).o sdram.o
+COBJS  = $(BOARD).o \
+       sdram.o \
+       ../common/nm_bsp.o
 SOBJS  = init.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c) $(addprefix ../common/,$(NOBJS:.o=.c))
+SRCS   := $(SOBJS:.o=.S) $(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) $(SOBJS)
+       $(AR) $(ARFLAGS) $@ $^
 
 clean:
        rm -f $(SOBJS) $(OBJS)