From b73df16d428ed1a0bc35f6f9e96cf6603210a4a5 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Fri, 4 Jun 2021 10:46:52 +0200 Subject: kbuild: add install target For CI, it would be useful to have the barebox build install the artifacts into a directory. Add an install target that does this. Example usage: make install INSTALL_PATH=install/ Unlike Linux, we don't set INSTALL_PATH to a default value, because most barebox-enabled boards don't have barebox in a file system. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20210604084704.17410-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ec17700425..65e3f6f80c 100644 --- a/Makefile +++ b/Makefile @@ -880,6 +880,20 @@ ifndef CONFIG_PBL_IMAGE $(call cmd,check_file_size,$@,$(CONFIG_BAREBOX_MAX_IMAGE_SIZE)) endif +install: +ifeq ($(INSTALL_PATH),) + @echo 'error: INSTALL_PATH undefined' >&2 + @exit 1 +endif +ifdef CONFIG_PBL_IMAGE + $(Q)$(MAKE) $(build)=images __images_install + @install -t "$(INSTALL_PATH)" barebox.bin +else + @install -t "$(INSTALL_PATH)" $(KBUILD_IMAGE) +endif + +PHONY += install + # By default the uImage load address is 2MB below CONFIG_TEXT_BASE, # leaving space for the compressed PBL image at 1MB below CONFIG_TEXT_BASE. UIMAGE_BASE ?= $(shell printf "0x%08x" $$(($(CONFIG_TEXT_BASE) - 0x200000))) -- cgit v1.2.1