summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-07-11 01:32:43 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-07-11 01:32:43 (EDT)
commit75af1eb87897df0f79d7ee125c87730bf5b3e361 (patch)
tree11e312e80ffea4a694cf183c2214bc713fea8d07
parent75d9846e256941b05b6d1330610fe9862a4ee9e0 (diff)
build: Run as many jobs as there are CPUs
-rwxr-xr-xbuild3
1 files changed, 2 insertions, 1 deletions
diff --git a/build b/build
index 5f604a0..0b00ac7 100755
--- a/build
+++ b/build
@@ -4,6 +4,7 @@ include ../source.mk
V = 1
KBUILD_ARCH = $$(oh-architecture "$${OPK_HOST_ARCH}")
+JOBS = $$(printf '%s\n' /sys/devices/system/cpu/cpu[0-9]* | wc -l)
# ProteanOS's GCC is currently broken: "-print-file-name=include" simply prints
# "include".
@@ -28,7 +29,7 @@ build:
sed $(nsif_sed) src/Makefile.orig 1>src/Makefile; \
fi; \
read img_src img_dest <image; \
- oh-autobuild -T "$${img_src}" -- -j "$${JOBS:-1}" V=$(V); \
+ oh-autobuild -T "$${img_src}" -- -j "$${JOBS:-$(JOBS)}" V=$(V); \
fi
touch $@