From f7a24052c28304aeff1b846619d0f62c7354c13b Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 16 Dec 2024 21:38:06 +0100 Subject: [PATCH] make makefile work for OSX --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8674ab134..ea61bda61 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,19 @@ T := $(shell $(MAKE) $(MAKECMDGOALS) --no-print-directory \ ECHO="COUNTTHIS" | grep -c "COUNTTHIS") N := x C = $(words $N)$(eval N := x $N) -ECHO = python $(I)/echo_progress.py --stepno=$C --nsteps=$T +ECHO = python3 $(I)/echo_progress.py --stepno=$C --nsteps=$T endif # number of parallel compiles -JOBS ?= $(shell nproc) +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Linux) + CFLAGS += -D LINUX + JOBS ?= $(shell nproc) +endif +ifeq ($(UNAME_S),Darwin) + CFLAGS += -D OSX + JOBS ?= $(shell sysctl -n hw.ncpu) +endif MAKEFLAGS += -j $(JOBS) -l $(JOBS) #----------------------------------------------------------------------