Skip to content

Commit

Permalink
build: use lazy evaluation for NPROC to speed up metadata dump
Browse files Browse the repository at this point in the history
Reduces package metadata dump time by ~10%

Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
nbd168 committed Jan 14, 2025
1 parent 3963dab commit dac8021
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dac8021

Please sign in to comment.