make makefile work for OSX

This commit is contained in:
proddy
2024-12-16 21:38:06 +01:00
parent 75c452486c
commit f7a24052c2

View File

@@ -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
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)
#----------------------------------------------------------------------