]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[build] Allow for per-architecture cross-compilation prefixes
authorMichael Brown <mcb30@ipxe.org>
Tue, 29 Oct 2024 12:50:37 +0000 (12:50 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 29 Oct 2024 14:11:08 +0000 (14:11 +0000)
commit8fc11d8a4ad41f15af3d081250865f971312d871
treea8c7cb048a52f2d53c8391da7ae63d86799f73dd
parent19f44d2998f6197b70fa2726c551bc8fe6956fa2
[build] Allow for per-architecture cross-compilation prefixes

We currently require the variable CROSS (or CROSS_COMPILE) to be set
to specify the global cross-compilation prefix.  This becomes
cumbersome when developing across multiple CPU architectures,
requiring frequent editing of build command lines and preventing
incompatible architectures from being built with a single command.

Allow a default cross-compilation prefix for each architecture to be
specified via the CROSS_COMPILE_<arch> variables.  These may then be
provided as environment variables, e.g. using

  export CROSS_COMPILE_arm32=arm-linux-gnu-
  export CROSS_COMPILE_arm64=aarch64-linux-gnu-
  export CROSS_COMPILE_loong64=loongarch64-linux-gnu-
  export CROSS_COMPILE_riscv32=riscv64-linux-gnu-
  export CROSS_COMPILE_riscv64=riscv64-linux-gnu-

This change requires some portions of the Makefile to be rearranged,
to allow for the fact that $(CROSS_COMPILE) may not have been set
until the build directory has been parsed to determine the CPU
architecture.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/Makefile
src/Makefile.housekeeping