summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-09-17 19:41:27 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-10-02 11:12:48 +0200
commit1c1198a3f252a9af91a128263c9ee25682cf7160 (patch)
tree52e0060b1f7299081f81a179c5f442f974d4d119 /Makefile
parentd297e90323f3f129feea237cd48a3fe9a290850b (diff)
downloadbarebox-1c1198a3f252a9af91a128263c9ee25682cf7160.tar.gz
barebox-1c1198a3f252a9af91a128263c9ee25682cf7160.tar.xz
scripts: allow building USB loader tools for target as well
We currently build the USB loader tools only for the host (build) system, but it can be useful to cross compile them as well for the target. We already have some target tools, but support for those is easier, because they don't link against libraries. We use pkg-config to get cc and ld flags, but we always assume that pkg-config is for the host system and there is no well-defined way to request pkg-config for the target system. Support this by introducing a new CROSS_PKG_CONFIG. This will be consulted only for target tools and default to $(CROSS_COMPILE)pkgconfig. Users can override it as necessary, for example, with Yocto, pkg-config will be for the cross environment, so target tools can now be built with: export ARCH=sandbox CROSS_COMPILE=aarch64-linux-gnu- export CROSS_PKG_CONFIG=pkg-config scripts make targettools_defconfig make scripts Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210917174127.23345-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 74e4893f02..bb00cfbe08 100644
--- a/Makefile
+++ b/Makefile
@@ -362,6 +362,8 @@ endif
KCONFIG_CONFIG ?= .config
+CROSS_PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
+
export KCONFIG_CONFIG
# SHELL used by kbuild
@@ -1126,11 +1128,16 @@ CLEAN_DIRS += $(MODVERDIR)
CLEAN_FILES += barebox System.map stickypage.bin include/generated/barebox_default_env.h \
.tmp_version .tmp_barebox* barebox.bin barebox.map \
.tmp_kallsyms* barebox.ldr compile_commands.json \
- scripts/bareboxenv-target barebox-flash-image \
+ barebox-flash-image \
barebox.srec barebox.s5p barebox.ubl barebox.zynq \
barebox.uimage barebox.spi barebox.kwb barebox.kwbuart \
barebox.efi barebox.canon-a1100.bin
+CLEAN_FILES += scripts/bareboxenv-target scripts/kernel-install-target \
+ scripts/bareboxcrc32-target scripts/bareboximd-target \
+ scripts/omap3-usb-loader-target scripts/omap4_usbboot-target \
+ scripts/imx-usb-loader-target scripts/kwboot-target
+
# Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config usr/include include/generated Documentation/commands
MRPROPER_FILES += .config .config.old .version .old_version \