81b23d02fc
U-Boot v2014.04 introduced significant changes in its build infrastrcture. Among things related to buildroot are: 1. Special new target ("tools-only") was added for building host tools alone 2. Tools cross-building for target is no longer possible with substitution of HOSTxx with TARGETxx because host binaries won't be built. Instead we just set CROSS_COMPILE and CROSS_BUILD_TOOLS variables. 3. Most of make targets now require U-Boot to be configured before building. So for building generic "fw_printenv" we now need to make "env" target config- independent. 4. HOSTCPPFLAGS are not used anywhere, so dropping "uboot-tools-02-hostcflags-override-fix.patch" Also due to lincese boilerplate change in sources "uboot-tools-01-drop-configh-from-tools.patch" required subtle changes. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Gustavo Zacarias <gustavo@zacarias.com.ar> Cc: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
84 lines
2.4 KiB
Makefile
84 lines
2.4 KiB
Makefile
################################################################################
|
|
#
|
|
# uboot-tools
|
|
#
|
|
################################################################################
|
|
|
|
UBOOT_TOOLS_VERSION = 2014.04
|
|
UBOOT_TOOLS_SOURCE = u-boot-$(UBOOT_TOOLS_VERSION).tar.bz2
|
|
UBOOT_TOOLS_SITE = ftp://ftp.denx.de/pub/u-boot
|
|
UBOOT_TOOLS_LICENSE = GPLv2+
|
|
UBOOT_TOOLS_LICENSE_FILES = Licenses/gpl-2.0.txt
|
|
|
|
define UBOOT_TOOLS_BUILD_CMDS
|
|
$(MAKE) -C $(@D) \
|
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
|
CROSS_BUILD_TOOLS=y \
|
|
tools-only
|
|
$(MAKE) -C $(@D) \
|
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
|
env no-dot-config-targets=env
|
|
endef
|
|
|
|
ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE),y)
|
|
define UBOOT_TOOLS_INSTALL_MKIMAGE
|
|
$(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(TARGET_DIR)/usr/bin/mkimage
|
|
endef
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE),y)
|
|
define UBOOT_TOOLS_INSTALL_MKENVIMAGE
|
|
$(INSTALL) -m 0755 -D $(@D)/tools/mkenvimage $(TARGET_DIR)/usr/bin/mkenvimage
|
|
endef
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV),y)
|
|
define UBOOT_TOOLS_INSTALL_FWPRINTENV
|
|
$(INSTALL) -m 0755 -D $(@D)/tools/env/fw_printenv $(TARGET_DIR)/usr/sbin/fw_printenv
|
|
ln -sf fw_printenv $(TARGET_DIR)/usr/sbin/fw_setenv
|
|
endef
|
|
endif
|
|
|
|
define UBOOT_TOOLS_INSTALL_TARGET_CMDS
|
|
$(UBOOT_TOOLS_INSTALL_MKIMAGE)
|
|
$(UBOOT_TOOLS_INSTALL_MKENVIMAGE)
|
|
$(UBOOT_TOOLS_INSTALL_FWPRINTENV)
|
|
endef
|
|
|
|
define HOST_UBOOT_TOOLS_BUILD_CMDS
|
|
$(MAKE1) -C $(@D) \
|
|
HOSTCC="$(HOSTCC)" \
|
|
HOSTCFLAGS="$(HOST_CFLAGS)" \
|
|
HOSTLDFLAGS="$(HOST_LDFLAGS)" \
|
|
tools-only
|
|
endef
|
|
|
|
define HOST_UBOOT_TOOLS_INSTALL_CMDS
|
|
$(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(HOST_DIR)/usr/bin/mkimage
|
|
$(INSTALL) -m 0755 -D $(@D)/tools/mkenvimage $(HOST_DIR)/usr/bin/mkenvimage
|
|
endef
|
|
|
|
$(eval $(generic-package))
|
|
$(eval $(host-generic-package))
|
|
|
|
# Convenience variables for other mk files that make use of mkimage
|
|
|
|
MKIMAGE = $(HOST_DIR)/usr/bin/mkimage
|
|
|
|
# mkimage supports arm avr32 blackfin m68k microblaze mips mips64 nios2 powerpc ppc sh sparc sparc64 x86
|
|
# KERNEL_ARCH can be arm64 arc arm avr32 blackfin m68k microblaze mips nios2 powerpc sh sparc i386 x86_64 xtensa
|
|
# For arm64, arc, xtensa we'll just keep KERNEL_ARCH
|
|
# For mips64, we'll just keep mips
|
|
# For i386 and x86_64, we need to convert
|
|
ifeq ($(KERNEL_ARCH),x86_64)
|
|
MKIMAGE_ARCH = x86
|
|
else ifeq ($(KERNEL_ARCH),i386)
|
|
MKIMAGE_ARCH = x86
|
|
else
|
|
MKIMAGE_ARCH = $(KERNEL_ARCH)
|
|
endif
|