aboutsummaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
Diffstat (limited to 'lang')
-rw-r--r--lang/maturin/Makefile1
-rw-r--r--lang/rust/Makefile13
-rw-r--r--lang/rust/rust-host-build.mk30
-rw-r--r--lang/rust/rust-package.mk21
4 files changed, 31 insertions, 34 deletions
diff --git a/lang/maturin/Makefile b/lang/maturin/Makefile
index e1c7ca50f..220e31fba 100644
--- a/lang/maturin/Makefile
+++ b/lang/maturin/Makefile
@@ -17,6 +17,7 @@ PKG_LICENSE:=Apache-2.0 MIT
PKG_LICENSE_FILES:=license-apache license-mit
HOST_BUILD_DEPENDS:=rust/host
+HOST_BUILD_PARALLEL:=1
PKG_HOST_ONLY:=1
include $(INCLUDE_DIR)/host-build.mk
diff --git a/lang/rust/Makefile b/lang/rust/Makefile
index 8f99f4144..d0a9ef48d 100644
--- a/lang/rust/Makefile
+++ b/lang/rust/Makefile
@@ -80,13 +80,12 @@ define Host/Uninstall
endef
define Host/Compile
- ( \
- cd $(HOST_BUILD_DIR) ; \
- CARGO_HOME=$(CARGO_HOME) \
- OPENWRT_RUSTC_BOOTSTRAP_CACHE=$(DL_DIR)/rustc \
- $(PYTHON) x.py --config ./config.toml dist build-manifest cargo llvm-tools \
- rustc rust-std rust-src ; \
- )
+ CARGO_HOME=$(CARGO_HOME) \
+ OPENWRT_RUSTC_BOOTSTRAP_CACHE=$(DL_DIR)/rustc \
+ $(PYTHON) $(HOST_BUILD_DIR)/x.py \
+ --build-dir $(HOST_BUILD_DIR)/build \
+ --config $(HOST_BUILD_DIR)/config.toml \
+ dist build-manifest cargo llvm-tools rustc rust-std rust-src
endef
define Host/Install
diff --git a/lang/rust/rust-host-build.mk b/lang/rust/rust-host-build.mk
index 38ce963e0..e56292937 100644
--- a/lang/rust/rust-host-build.mk
+++ b/lang/rust/rust-host-build.mk
@@ -17,29 +17,27 @@ include $(RUST_INCLUDE_DIR)/rust-values.mk
CARGO_HOST_VARS= \
$(CARGO_HOST_CONFIG_VARS) \
- CC=$(HOSTCC_NOCACHE)
+ CC=$(HOSTCC_NOCACHE) \
+ MAKEFLAGS="$(HOST_JOBS)"
# $(1) path to the package (optional)
# $(2) additional arguments to cargo (optional)
define Host/Compile/Cargo
- ( \
- cd $(HOST_BUILD_DIR) ; \
- $(CARGO_HOST_VARS) \
- cargo install -v \
- --profile $(CARGO_HOST_PROFILE) \
- $(if $(RUST_HOST_FEATURES),--features "$(RUST_HOST_FEATURES)") \
- --root $(HOST_INSTALL_DIR) \
- --path "$(if $(strip $(1)),$(strip $(1)),.)" $(2) ; \
- )
+ +$(CARGO_HOST_VARS) \
+ cargo install -v \
+ --profile $(CARGO_HOST_PROFILE) \
+ $(if $(RUST_HOST_FEATURES),--features "$(RUST_HOST_FEATURES)") \
+ --root $(HOST_INSTALL_DIR) \
+ --path "$(HOST_BUILD_DIR)/$(if $(strip $(1)),$(strip $(1)))" \
+ $(if $(filter --jobserver%,$(HOST_JOBS)),,-j1) \
+ $(2)
endef
define Host/Uninstall/Cargo
- ( \
- cd $(HOST_BUILD_DIR) ; \
- $(CARGO_HOST_VARS) \
- cargo uninstall -v \
- --root $(HOST_INSTALL_DIR) || true ; \
- )
+ +$(CARGO_HOST_VARS) \
+ cargo uninstall -v \
+ --root $(HOST_INSTALL_DIR) \
+ || true
endef
define RustBinHostBuild
diff --git a/lang/rust/rust-package.mk b/lang/rust/rust-package.mk
index 6deb859fb..24341d706 100644
--- a/lang/rust/rust-package.mk
+++ b/lang/rust/rust-package.mk
@@ -17,21 +17,20 @@ include $(RUST_INCLUDE_DIR)/rust-values.mk
CARGO_PKG_VARS= \
$(CARGO_PKG_CONFIG_VARS) \
- CC=$(HOSTCC_NOCACHE)
+ CC=$(HOSTCC_NOCACHE) \
+ MAKEFLAGS="$(PKG_JOBS)"
# $(1) path to the package (optional)
# $(2) additional arguments to cargo (optional)
define Build/Compile/Cargo
- ( \
- cd $(PKG_BUILD_DIR) ; \
- $(CARGO_PKG_VARS) \
- cargo install -v \
- --profile $(CARGO_PKG_PROFILE) \
- $(if $(strip $(RUST_PKG_FEATURES)),--features "$(strip $(RUST_PKG_FEATURES))") \
- --root $(PKG_INSTALL_DIR) \
- --path "$(if $(strip $(1)),$(strip $(1)),.)" \
- $(2) ; \
- )
+ +$(CARGO_PKG_VARS) \
+ cargo install -v \
+ --profile $(CARGO_PKG_PROFILE) \
+ $(if $(strip $(RUST_PKG_FEATURES)),--features "$(strip $(RUST_PKG_FEATURES))") \
+ --root $(PKG_INSTALL_DIR) \
+ --path "$(PKG_BUILD_DIR)/$(if $(strip $(1)),$(strip $(1)))" \
+ $(if $(filter --jobserver%,$(PKG_JOBS)),,-j1) \
+ $(2)
endef
define RustBinPackage