From 0f05c481fd445d49fdea6962952a84d53d03da1c Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 22 Sep 2026 20:07:06 +0200 Subject: [PATCH] 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 --- tools/lzma/Makefile | 5 +++-- tools/mkimage/Makefile | 3 ++- tools/mtools/Makefile | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/lzma/Makefile b/tools/lzma/Makefile index 29f7e0fb1d6..a83d4aba730 100644 --- a/tools/lzma/Makefile +++ b/tools/lzma/Makefile @@ -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 diff --git a/tools/mkimage/Makefile b/tools/mkimage/Makefile index 560709e418f..ed437cf20c2 100644 --- a/tools/mkimage/Makefile +++ b/tools/mkimage/Makefile @@ -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" \ diff --git a/tools/mtools/Makefile b/tools/mtools/Makefile index 8d4a54a698c..0d38c0c9e60 100644 --- a/tools/mtools/Makefile +++ b/tools/mtools/Makefile @@ -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