From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.thorsis.com ([92.198.35.195]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iX3lR-0004dy-DM for ptxdist@pengutronix.de; Tue, 19 Nov 2019 14:41:53 +0100 Received: from localhost (localhost [127.0.0.1]) by mail.thorsis.com (Postfix) with ESMTP id 6D8A44797 for ; Tue, 19 Nov 2019 14:43:02 +0100 (CET) Received: from mail.thorsis.com ([127.0.0.1]) by localhost (mail.thorsis.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XnfvS0ivnhPQ for ; Tue, 19 Nov 2019 14:43:02 +0100 (CET) From: Alexander Dahl Date: Tue, 19 Nov 2019 14:41:46 +0100 Message-Id: <20191119134146.2808-3-ada@thorsis.com> In-Reply-To: <20191119134146.2808-1-ada@thorsis.com> References: <20191119134146.2808-1-ada@thorsis.com> Subject: [ptxdist] [PATCH 2/2] u-boot: Build out-of-tree List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Denis OSTERLAND , Bruno Thomsen Like barebox and kernel, u-boot can be built out-of-tree, only few modifications are necessary. This is especially nice when working in the source tree U-Boot is built from. Cc: Bruno Thomsen Cc: Denis OSTERLAND Signed-off-by: Alexander Dahl --- rules/u-boot.make | 58 ++++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/rules/u-boot.make b/rules/u-boot.make index 1aabe61b1..e3c2c2389 100644 --- a/rules/u-boot.make +++ b/rules/u-boot.make @@ -16,14 +16,16 @@ PACKAGES-$(PTXCONF_U_BOOT) += u-boot # # Paths and names # -U_BOOT_VERSION := $(call remove_quotes,$(PTXCONF_U_BOOT_VERSION)) -U_BOOT_MD5 := $(call remove_quotes,$(PTXCONF_U_BOOT_MD5)) -U_BOOT := u-boot-$(U_BOOT_VERSION) -U_BOOT_SUFFIX := tar.bz2 -U_BOOT_URL := https://ftp.denx.de/pub/u-boot/$(U_BOOT).$(U_BOOT_SUFFIX) -U_BOOT_SOURCE := $(SRCDIR)/$(U_BOOT).$(U_BOOT_SUFFIX) -U_BOOT_DIR := $(BUILDDIR)/$(U_BOOT) -U_BOOT_DEVPKG := NO +U_BOOT_VERSION := $(call remove_quotes,$(PTXCONF_U_BOOT_VERSION)) +U_BOOT_MD5 := $(call remove_quotes,$(PTXCONF_U_BOOT_MD5)) +U_BOOT := u-boot-$(U_BOOT_VERSION) +U_BOOT_SUFFIX := tar.bz2 +U_BOOT_URL := https://ftp.denx.de/pub/u-boot/$(U_BOOT).$(U_BOOT_SUFFIX) +U_BOOT_SOURCE := $(SRCDIR)/$(U_BOOT).$(U_BOOT_SUFFIX) +U_BOOT_DIR := $(BUILDDIR)/$(U_BOOT) +U_BOOT_BUILD_DIR := $(U_BOOT_DIR)-build +U_BOOT_DEVPKG := NO +U_BOOT_BUILD_OOT := KEEP ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_KCONFIG U_BOOT_CONFIG := $(call ptx/in-platformconfigdir, \ @@ -44,10 +46,16 @@ endif U_BOOT_WRAPPER_BLACKLIST := \ $(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST) +U_BOOT_CONF_OPT := \ + -C $(U_BOOT_DIR) \ + O=$(U_BOOT_BUILD_DIR) \ + V=$(PTXDIST_VERBOSE) + U_BOOT_MAKE_ENV := \ CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) \ HOSTCC=$(HOSTCC) -U_BOOT_MAKE_OPT := V=$(PTXDIST_VERBOSE) +U_BOOT_MAKE_OPT := $(U_BOOT_CONF_OPT) + U_BOOT_TAGS_OPT := ctags cscope etags ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_KCONFIG @@ -57,9 +65,7 @@ endif ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_LEGACY U_BOOT_CONF_ENV := PATH=$(CROSS_PATH) $(U_BOOT_MAKE_ENV) -U_BOOT_CONF_OPT := \ - $(U_BOOT_MAKE_OPT) \ - $(call remove_quotes, $(PTXCONF_U_BOOT_CONFIG)) +U_BOOT_CONF_OPT += $(call remove_quotes, $(PTXCONF_U_BOOT_CONFIG)) U_BOOT_MAKE_PAR := NO endif @@ -79,7 +85,7 @@ endif ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_LEGACY $(STATEDIR)/u-boot.prepare: @$(call targetinfo) - $(U_BOOT_CONF_ENV) $(MAKE) -C $(U_BOOT_DIR) $(U_BOOT_CONF_OPT) + $(U_BOOT_CONF_ENV) $(MAKE) $(U_BOOT_CONF_OPT) @$(call touch) endif @@ -91,9 +97,9 @@ $(STATEDIR)/u-boot.compile: @$(call targetinfo) @$(call world/compile, U_BOOT) ifdef PTXCONF_U_BOOT_BOOT_SCRIPT - @$(U_BOOT_DIR)/tools/mkimage -T script -C none \ + @$(U_BOOT_BUILD_DIR)/tools/mkimage -T script -C none \ -d $(U_BOOT_BOOT_SCRIPT_TXT) \ - $(U_BOOT_DIR)/boot.scr.uimg + $(U_BOOT_BUILD_DIR)/boot.scr.uimg endif @$(call touch) @@ -111,34 +117,34 @@ $(STATEDIR)/u-boot.install: $(STATEDIR)/u-boot.targetinstall: @$(call targetinfo) - @install -v -D -m644 $(U_BOOT_DIR)/u-boot.bin $(IMAGEDIR)/u-boot.bin + @install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot.bin $(IMAGEDIR)/u-boot.bin ifdef PTXCONF_U_BOOT_INSTALL_SREC - @install -v -D -m644 $(U_BOOT_DIR)/u-boot.srec $(IMAGEDIR)/u-boot.srec + @install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot.srec $(IMAGEDIR)/u-boot.srec endif ifdef PTXCONF_U_BOOT_INSTALL_ELF - @install -v -D -m644 $(U_BOOT_DIR)/u-boot $(IMAGEDIR)/u-boot.elf + @install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot $(IMAGEDIR)/u-boot.elf endif ifdef PTXCONF_U_BOOT_INSTALL_SPL - @install -v -D -m644 $(U_BOOT_DIR)/SPL $(IMAGEDIR)/SPL + @install -v -D -m644 $(U_BOOT_BUILD_DIR)/SPL $(IMAGEDIR)/SPL endif ifdef PTXCONF_U_BOOT_INSTALL_MLO - @install -v -D -m644 $(U_BOOT_DIR)/MLO $(IMAGEDIR)/MLO + @install -v -D -m644 $(U_BOOT_BUILD_DIR)/MLO $(IMAGEDIR)/MLO endif ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_IMG - @install -v -D -m644 $(U_BOOT_DIR)/u-boot.img $(IMAGEDIR)/u-boot.img + @install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot.img $(IMAGEDIR)/u-boot.img endif ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_IMX - @install -v -D -m644 $(U_BOOT_DIR)/u-boot.imx $(IMAGEDIR)/u-boot.imx + @install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot.imx $(IMAGEDIR)/u-boot.imx endif ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_DTB_IMX - @install -v -D -m644 $(U_BOOT_DIR)/u-boot-dtb.imx $(IMAGEDIR)/u-boot-dtb.imx + @install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot-dtb.imx $(IMAGEDIR)/u-boot-dtb.imx endif ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_DTB - @install -v -D -m644 $(U_BOOT_DIR)/u-boot-dtb.bin \ + @install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot-dtb.bin \ $(IMAGEDIR)/u-boot-dtb.bin endif ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL - @install -v -D -m644 $(U_BOOT_DIR)/u-boot-with-spl-pbl.bin \ + @install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot-with-spl-pbl.bin \ $(IMAGEDIR)/u-boot-with-spl-pbl.bin endif @@ -150,7 +156,7 @@ ifdef PTXCONF_U_BOOT_BOOT_SCRIPT @$(call install_fixup, u-boot, DESCRIPTION, "U-Boot boot script") @$(call install_copy, u-boot, 0, 0, 0644, \ - $(U_BOOT_DIR)/boot.scr.uimg, $(U_BOOT_BOOT_SCRIPT_BIN)) + $(U_BOOT_BUILD_DIR)/boot.scr.uimg, $(U_BOOT_BOOT_SCRIPT_BIN)) @$(call install_finish, u-boot) endif -- 2.20.1 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de