9
0
Fork 0

kbuild: keep the barebox binary accessible

When building a special image  from the original (compressed or
not) binary, to not overwrite KBUILD_BINARY.

This allows producing multiple images (such as MLO, UBL, ...)
from the (z)barebox.bin. In the case where no special image is
used, KBUILD_IMAGE is set to KBUILD_BINARY.

This patch was developed together with Sascha Hauer. Thanks!

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Jan Luebbe 2012-09-06 12:20:15 +02:00 committed by Sascha Hauer
parent 25fc2ca049
commit 606feec236
2 changed files with 16 additions and 10 deletions

View File

@ -462,12 +462,18 @@ CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
# disable pointer signed / unsigned warnings in gcc 4.0
CFLAGS += $(call cc-option,-Wno-pointer-sign,)
# Default kernel image to build when no specific target is given.
# KBUILD_IMAGE may be overruled on the command line or
# set in the environment
# Also any assignments in arch/$(ARCH)/Makefile take precedence over
# this default value
# KBUILD_IMAGE: Default barebox image to build
# Depending on the architecture, this can be either compressed or not.
# It will also include any necessary headers to be bootable.
export KBUILD_IMAGE ?= barebox.bin
# KBUILD_BINARY: Raw barebox binary
# This variable is set in case the architecture prepends a header and
# points to a binary that can be loaded directly into RAM and executed.
export KBUILD_BINARY ?= barebox.bin
# KBUILD_IMAGE and _BINARY may be overruled on the command line or
# set in the environment.
# Also any assignments in arch/$(ARCH)/Makefile take precedence over
# the default value.
barebox-flash-image: $(KBUILD_IMAGE)
$(call if_changed,ln)

View File

@ -179,7 +179,7 @@ barebox.netx: $(KBUILD_BINARY)
ifeq ($(machine-y),netx)
KBUILD_TARGET := barebox.netx
KBUILD_BINARY := $(KBUILD_TARGET)
KBUILD_IMAGE := barebox.netx
endif
barebox.s5p: $(KBUILD_BINARY)
@ -187,7 +187,7 @@ barebox.s5p: $(KBUILD_BINARY)
ifeq ($(CONFIG_ARCH_S5PCxx),y)
KBUILD_TARGET := barebox.s5p
KBUILD_BINARY := $(KBUILD_TARGET)
KBUILD_IMAGE := barebox.s5p
endif
quiet_cmd_mlo ?= IFT $@
@ -199,7 +199,7 @@ MLO: $(KBUILD_BINARY)
ifeq ($(CONFIG_OMAP_BUILD_IFT),y)
KBUILD_TARGET := MLO
KBUILD_BINARY := $(KBUILD_TARGET)
KBUILD_IMAGE := MLO
endif
barebox.ubl: $(KBUILD_BINARY)
@ -209,7 +209,7 @@ barebox.ubl: $(KBUILD_BINARY)
ifeq ($(CONFIG_ARCH_DAVINCI),y)
KBUILD_TARGET := barebox.ubl
KBUILD_BINARY := $(KBUILD_TARGET)
KBUILD_IMAGE := barebox.ubl
endif
pbl := arch/arm/pbl
@ -219,7 +219,7 @@ zbarebox.S zbarebox.bin zbarebox: barebox.bin
archclean:
$(MAKE) $(clean)=$(pbl)
KBUILD_IMAGE := $(KBUILD_BINARY)
KBUILD_IMAGE ?= $(KBUILD_BINARY)
archprepare: maketools
maketools: