From a3302ebc8260be71590dbe3a0b2d7741a9019532 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Thu, 30 May 2024 01:14:30 -0400 Subject: [PATCH] Get processor count when building on FreeBSD --- helpful-things/Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/helpful-things/Makefile b/helpful-things/Makefile index b5be64c..4c2d661 100644 --- a/helpful-things/Makefile +++ b/helpful-things/Makefile @@ -1,8 +1,13 @@ # You can use this makefile in your # build directory to drive ninja builds. -processor_count=$(shell grep -c "^processor" /proc/cpuinfo) -#count=$(shell expr ${processor_count} - 1) +# The makefile requires gnu make + +ifneq ("$(wildcard /proc/cpuinfo)","") + processor_count=$(shell grep -c "^processor" /proc/cpuinfo) +else # Assume FreeBSD for now... + processor_count=`sysctl -n kern.smp.cpus` +endif count=$(shell expr $(processor_count) - 1 ) __primary: test