tools: pass the job server to the compile step of mtools, mkimage and lzma

host-build.mk clears MAKEFLAGS, so a custom Host/Compile that runs a bare
$(MAKE) builds with one job, whatever HOST_BUILD_PARALLEL says. mtools
sets the flag, but its compile step never used it.

Each of the three now passes $(HOST_JOBS), and mkimage and lzma set
HOST_BUILD_PARALLEL:

  mkimage  11.7 s -> 7.2 s
  mtools    8.3 s -> 4.8 s
  lzma      4.0 s -> 1.8 s

Each one builds five times out of five with the job server, and each
build installs files that are identical to those of a serial build.

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin committed 2026-09-22 20:29:59 +02:00
1 parent 56d9cd66a8
commit 0f05c481fd
3 files changed
+6 -4

No files matched your search

+3 -2
View File
@@ -14,6 +14,7 @@ PKG_SOURCE_URL:=@OPENWRT
PKG_HASH:=dcbdb5f4843eff638e4a5e8be0e2486a3c5483df73c70823618db8e66f609ec2
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
@@ -21,8 +22,8 @@ UTIL_DIR=$(HOST_BUILD_DIR)/C/LzmaUtil
ALONE_DIR=$(HOST_BUILD_DIR)/CPP/7zip/Compress/LZMA_Alone
define Host/Compile
$(MAKE) -C $(UTIL_DIR) -f makefile.gcc
$(MAKE) -C $(ALONE_DIR) -f makefile.gcc
+$(MAKE) $(HOST_JOBS) -C $(UTIL_DIR) -f makefile.gcc
+$(MAKE) $(HOST_JOBS) -C $(ALONE_DIR) -f makefile.gcc
endef
define Host/Install
+2 -1
View File
@@ -16,6 +16,7 @@ PKG_SOURCE_URL:= \
PKG_HASH:=78e8bfc382fe388f9b55aa1daf8c563522a037779b5d4c349d1415e381f1243e
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/u-boot-$(PKG_VERSION)
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
@@ -35,7 +36,7 @@ define Host/Configure
endef
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR) \
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
HOSTCFLAGS="$(HOST_CFLAGS)" \
HOSTLDFLAGS="$(HOST_LDFLAGS)" \
PKG_CONFIG_EXTRAARGS="--static" \
+1 -1
View File
@@ -23,7 +23,7 @@ HOST_CONFIGURE_VARS += \
ac_cv_header_iconv_h=no
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR) mcopy mmd
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) mcopy mmd
endef
define Host/Install