Skip to content

Commit

Permalink
make makefile work for OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Dec 16, 2024
1 parent 75c4524 commit f7a2405
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

#----------------------------------------------------------------------
Expand Down

0 comments on commit f7a2405

Please sign in to comment.