build: use lazy evaluation for NPROC to speed up metadata dump
authorFelix Fietkau <nbd@nbd.name>
Tue, 14 Jan 2025 13:02:16 +0000 (14:02 +0100)
committerFelix Fietkau <nbd@nbd.name>
Tue, 14 Jan 2025 13:04:53 +0000 (14:04 +0100)
Reduces package metadata dump time by ~10%

Signed-off-by: Felix Fietkau <nbd@nbd.name>
rules.mk

index 16d6020e1a0efe5fbd1587a0e5123de1559c82f7..dbc448e1a432c92cd11b0af74ba6155a712da2b0 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -96,7 +96,7 @@ TARGET_SUFFIX=$(call qstrip,$(CONFIG_TARGET_SUFFIX))
 BUILD_SUFFIX:=$(call qstrip,$(CONFIG_BUILD_SUFFIX))
 SUBDIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR})
 BUILD_SUBDIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR})
-NPROC:=$(shell sysctl -n hw.ncpu 2>/dev/null || nproc)
+NPROC=$(shell sysctl -n hw.ncpu 2>/dev/null || nproc)
 export SHELL:=/usr/bin/env bash
 
 IS_PACKAGE_BUILD := $(if $(filter package/%,$(BUILD_SUBDIR)),1)