Commit f9328639 authored by Marian Balakowicz's avatar Marian Balakowicz

Add support for a saving build objects in a separate directory.

Modifications are based on the linux kernel approach and
support two use cases:

  1) Add O= to the make command line
  'make O=/tmp/build all'

  2) Set environement variable BUILD_DIR to point to the desired location
  'export BUILD_DIR=/tmp/build'
  'make'

The second approach can also be used with a MAKEALL script
'export BUILD_DIR=/tmp/build'
'./MAKEALL'

Command line 'O=' setting overrides BUILD_DIR environent variable.

When none of the above methods is used the local build is performed and
the object files are placed in the source directory.
parent 24d3d375
...@@ -2,6 +2,26 @@ ...@@ -2,6 +2,26 @@
Changes since U-Boot 1.1.4: Changes since U-Boot 1.1.4:
====================================================================== ======================================================================
* Add support for a saving build objects in a separate directory.
Modifications are based on the linux kernel approach and
support two use cases:
1) Add O= to the make command line
'make O=/tmp/build all'
2) Set environement variable BUILD_DIR to point to the desired location
'export BUILD_DIR=/tmp/build'
'make'
The second approach can also be used with a MAKEALL script
'export BUILD_DIR=/tmp/build'
'./MAKEALL'
Command line 'O=' setting overrides BUILD_DIR environent variable.
When none of the above methods is used the local build is performed and
the object files are placed in the source directory.
* Remove the board/netstar/crcit binary from git repository. * Remove the board/netstar/crcit binary from git repository.
* Fix tools/updater build error. * Fix tools/updater build error.
......
...@@ -8,7 +8,17 @@ else ...@@ -8,7 +8,17 @@ else
MAKE=make MAKE=make
fi fi
[ -d LOG ] || mkdir LOG || exit 1 if [ "${MAKEALL_LOGDIR}" ] ; then
LOG_DIR=${MAKEALL_LOGDIR}
else
LOG_DIR="LOG"
fi
if [ ! "${BUILD_DIR}" ] ; then
BUILD_DIR="."
fi
[ -d ${MAKEALL_LOGDIR} ] || mkdir ${MAKEALL_LOGDIR} || exit 1
LIST="" LIST=""
...@@ -303,8 +313,12 @@ build_target() { ...@@ -303,8 +313,12 @@ build_target() {
${MAKE} distclean >/dev/null ${MAKE} distclean >/dev/null
${MAKE} ${target}_config ${MAKE} ${target}_config
${MAKE} ${JOBS} all 2>&1 >LOG/$target.MAKELOG | tee LOG/$target.ERR
${CROSS_COMPILE:-ppc_8xx-}size u-boot | tee -a LOG/$target.MAKELOG ${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \
| tee ${LOG_DIR}/$target.ERR
${CROSS_COMPILE:-ppc_8xx-}size ${BUILD_DIR}/u-boot \
| tee -a ${LOG_DIR}/$target.MAKELOG
} }
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
......
This diff is collapsed.
# #
# (C) Copyright 2003 # (C) Copyright 2003-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
# #
# See file CREDITS for list of people who contributed to this # See file CREDITS for list of people who contributed to this
...@@ -23,18 +23,22 @@ ...@@ -23,18 +23,22 @@
include $(TOPDIR)/config.mk include $(TOPDIR)/config.mk
LIB = lib$(BOARD).a LIB = $(obj)lib$(BOARD).a
OBJS = $(BOARD).o flash.o COBJS = $(BOARD).o flash.o
$(LIB): .depend $(OBJS) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS) $(AR) crv $@ $(OBJS)
######################################################################### #########################################################################
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) # defines $(obj).depend target
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ include $(SRCTREE)/rules.mk
sinclude .depend sinclude $(obj).depend
######################################################################### #########################################################################
# #
# (C) Copyright 2000-2003 # (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
# #
# See file CREDITS for list of people who contributed to this # See file CREDITS for list of people who contributed to this
...@@ -23,18 +23,22 @@ ...@@ -23,18 +23,22 @@
include $(TOPDIR)/config.mk include $(TOPDIR)/config.mk
LIB = lib$(BOARD).a LIB = $(obj)lib$(BOARD).a
OBJS = $(BOARD).o cfm_flash.o flash.o VCxK.o COBJS = $(BOARD).o cfm_flash.o flash.o VCxK.o
$(LIB): .depend $(OBJS) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS) $(AR) crv $@ $(OBJS)
######################################################################### #########################################################################
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) # defines $(obj).depend target
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ include $(SRCTREE)/rules.mk
sinclude .depend sinclude $(obj).depend
######################################################################### #########################################################################
TEXT_BASE = 0xF0000000 TEXT_BASE = 0xFFE00000
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
# Copyright (C) 2000, 2001, 2002, 2003 # Copyright (C) 2000, 2001, 2002, 2003
# The LEOX team <team@leox.org>, http://www.leox.org # The LEOX team <team@leox.org>, http://www.leox.org
# #
# (C) Copyright 2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# LEOX.org is about the development of free hardware and software resources # LEOX.org is about the development of free hardware and software resources
# for system on chip. # for system on chip.
# #
...@@ -31,18 +34,22 @@ ...@@ -31,18 +34,22 @@
include $(TOPDIR)/config.mk include $(TOPDIR)/config.mk
LIB = lib$(BOARD).a LIB = $(obj)lib$(BOARD).a
COBJS = $(BOARD).o flash.o
OBJS = $(BOARD).o flash.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): .depend $(OBJS) $(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS) $(AR) crv $@ $(OBJS)
######################################################################### #########################################################################
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) # defines $(obj).depend target
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ include $(SRCTREE)/rules.mk
sinclude .depend sinclude $(obj).depend
######################################################################### #########################################################################
# #
# (C) Copyright 2002 # (C) Copyright 2002-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
# #
# See file CREDITS for list of people who contributed to this # See file CREDITS for list of people who contributed to this
...@@ -22,8 +22,12 @@ ...@@ -22,8 +22,12 @@
# #
include $(TOPDIR)/config.mk include $(TOPDIR)/config.mk
ifneq ($(OBJTREE),$(SRCTREE))
$(shell mkdir -p $(obj)../menu)
$(shell mkdir -p $(obj)../bios_emulator)
endif
LIB = lib$(BOARD).a LIB = $(obj)lib$(BOARD).a
COBJS = $(BOARD).o articiaS.o flash.o serial.o smbus.o articiaS_pci.o \ COBJS = $(BOARD).o articiaS.o flash.o serial.o smbus.o articiaS_pci.o \
via686.o i8259.o ../bios_emulator/x86interface.o \ via686.o i8259.o ../bios_emulator/x86interface.o \
...@@ -31,26 +35,29 @@ COBJS = $(BOARD).o articiaS.o flash.o serial.o smbus.o articiaS_pci.o \ ...@@ -31,26 +35,29 @@ COBJS = $(BOARD).o articiaS.o flash.o serial.o smbus.o articiaS_pci.o \
interrupts.o ps2kbd.o video.o usb_uhci.o enet.o \ interrupts.o ps2kbd.o video.o usb_uhci.o enet.o \
../menu/cmd_menu.o cmd_boota.o nvram.o ../menu/cmd_menu.o cmd_boota.o nvram.o
AOBJS = board_asm_init.o memio.o SOBJS = board_asm_init.o memio.o
OBJS = $(COBJS) $(AOBJS)
EMUDIR = ../bios_emulator/scitech/src/x86emu/ EMUDIR = ../bios_emulator/scitech/src/x86emu/
EMUOBJ = $(EMUDIR)decode.o $(EMUDIR)ops2.o $(EMUDIR)fpu.o $(EMUDIR)prim_ops.o \ EMUOBJ = $(EMUDIR)decode.o $(EMUDIR)ops2.o $(EMUDIR)fpu.o $(EMUDIR)prim_ops.o \
$(EMUDIR)ops.o $(EMUDIR)sys.o $(EMUDIR)ops.o $(EMUDIR)sys.o
EMUSRC = $(EMUOBJ:.o=.c) EMUSRC = $(EMUOBJ:.o=.c)
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
EMUOBJ := $(addprefix $(obj),$(EMUOBJ))
$(LIB): .depend $(OBJS) $(EMUSRC) $(LIB): $(obj).depend $(OBJS) $(SOBJS) $(EMUSRC)
make libx86emu.a -C ../bios_emulator/scitech/src/x86emu -f makefile.uboot CROSS_COMPILE=$(CROSS_COMPILE) make $(obj)libx86emu.a -C ../bios_emulator/scitech/src/x86emu -f makefile.uboot CROSS_COMPILE=$(CROSS_COMPILE)
-rm $(LIB) -rm $(LIB)
$(AR) crv $@ $(OBJS) $(EMUOBJ) $(AR) crv $@ $(OBJS) $(SOBJS) $(EMUOBJ)
######################################################################### #########################################################################
.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c) # defines $(obj).depend target
$(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@ include $(SRCTREE)/rules.mk
sinclude .depend sinclude $(obj).depend
######################################################################### #########################################################################
# #
# (C) Copyright 2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# (C) Copyright 2001 # (C) Copyright 2001
# Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc. # Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
# #
...@@ -22,23 +25,30 @@ ...@@ -22,23 +25,30 @@
# #
include $(TOPDIR)/config.mk include $(TOPDIR)/config.mk
ifneq ($(OBJTREE),$(SRCTREE))
$(shell mkdir -p $(obj)../common)
endif
LIB = lib$(BOARD).a LIB = $(obj)lib$(BOARD).a
SOBJS = ../common/misc.o SOBJS = ../common/misc.o
OBJS = $(BOARD).o ../common/flash.o ../common/serial.o ../common/memory.o pci.o \ COBJS = $(BOARD).o ../common/flash.o ../common/serial.o ../common/memory.o pci.o \
mv_eth.o ../common/ns16550.o mpsc.o ../common/i2c.o \ mv_eth.o ../common/ns16550.o mpsc.o ../common/i2c.o \
sdram_init.o ../common/intel_flash.o sdram_init.o ../common/intel_flash.o
$(LIB): .depend $(OBJS) $(SOBJS) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) crv $@ $(OBJS) $(SOBJS) $(AR) crv $@ $(OBJS) $(SOBJS)
######################################################################### #########################################################################
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) # defines $(obj).depend target
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ include $(SRCTREE)/rules.mk
sinclude .depend sinclude $(obj).depend
######################################################################### #########################################################################
# #
# (C) Copyright 2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# (C) Copyright 2001 # (C) Copyright 2001
# Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc. # Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
# #
...@@ -22,23 +25,30 @@ ...@@ -22,23 +25,30 @@
# #
include $(TOPDIR)/config.mk include $(TOPDIR)/config.mk
ifneq ($(OBJTREE),$(SRCTREE))
$(shell mkdir -p $(obj)../common)
endif
LIB = lib$(BOARD).a LIB = $(obj)lib$(BOARD).a
SOBJS = ../common/misc.o SOBJS = ../common/misc.o
OBJS = $(BOARD).o ../common/flash.o ../common/serial.o ../common/memory.o pci.o \ COBJS = $(BOARD).o ../common/flash.o ../common/serial.o ../common/memory.o pci.o \
mv_eth.o ../common/ns16550.o mpsc.o ../common/i2c.o \ mv_eth.o ../common/ns16550.o mpsc.o ../common/i2c.o \
sdram_init.o ../common/intel_flash.o sdram_init.o ../common/intel_flash.o
$(LIB): .depend $(OBJS) $(SOBJS) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) crv $@ $(OBJS) $(SOBJS) $(AR) crv $@ $(OBJS) $(SOBJS)
######################################################################### #########################################################################
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) # defines $(obj).depend target
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ include $(SRCTREE)/rules.mk
sinclude .depend sinclude $(obj).depend
######################################################################### #########################################################################
# #
# (C) Copyright 2000 # (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
# #
# See file CREDITS for list of people who contributed to this # See file CREDITS for list of people who contributed to this
...@@ -23,18 +23,22 @@ ...@@ -23,18 +23,22 @@
include $(TOPDIR)/config.mk include $(TOPDIR)/config.mk
LIB = lib$(BOARD).a LIB = $(obj)lib$(BOARD).a
OBJS = $(BOARD).o flash.o eccx.o COBJS = $(BOARD).o flash.o eccx.o
$(LIB): .depend $(OBJS) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS) $(AR) crv $@ $(OBJS)
######################################################################### #########################################################################
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) # defines $(obj).depend target
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ include $(SRCTREE)/rules.mk
sinclude .depend sinclude $(obj).depend
######################################################################### #########################################################################
# #
# (C) Copyright 2000 # (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
# #
# See file CREDITS for list of people who contributed to this # See file CREDITS for list of people who contributed to this
...@@ -23,18 +23,22 @@ ...@@ -23,18 +23,22 @@
include $(TOPDIR)/config.mk include $(TOPDIR)/config.mk
LIB = lib$(BOARD).a LIB = $(obj)lib$(BOARD).a
OBJS = $(BOARD).o flash.o COBJS = $(BOARD).o flash.o
$(LIB): .depend $(OBJS) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS) $(AR) crv $@ $(OBJS)
######################################################################### #########################################################################
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) # defines $(obj).depend target
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ include $(SRCTREE)/rules.mk
sinclude .depend sinclude $(obj).depend
######################################################################### #########################################################################
# #
# (C) Copyright 2000-2004 # (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
# #
# See file CREDITS for list of people who contributed to this # See file CREDITS for list of people who contributed to this
...@@ -23,18 +23,22 @@ ...@@ -23,18 +23,22 @@
include $(TOPDIR)/config.mk include $(TOPDIR)/config.mk
LIB = lib$(BOARD).a LIB = $(obj)lib$(BOARD).a
OBJS = $(BOARD).o flash.o COBJS = $(BOARD).o flash.o
$(LIB): .depend $(OBJS) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS) $(AR) crv $@ $(OBJS)
######################################################################### #########################################################################
.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) # defines $(obj).depend target
$(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ include $(SRCTREE)/rules.mk
sinclude .depend sinclude $(obj).depend
######################################################################### #########################################################################
# #
# (C) Copyright 2000-2002 # (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
# #
# See file CREDITS for list of people who contributed to this # See file CREDITS for list of people who contributed to this
...@@ -23,18 +23,22 @@ ...@@ -23,18 +23,22 @@
include $(TOPDIR)/config.mk include $(TOPDIR)/config.mk
LIB = lib$(BOARD).a LIB = $(obj)lib$(BOARD).a
OBJS = $(BOARD).o flash.o COBJS = $(BOARD).o flash.o
$(LIB): .depend $(OBJS) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS)
$(AR) crv $@ $(OBJS) $(AR) crv $@ $(OBJS)
######################################################################### #########################################################################