diff options
| author | Christian Walther <cwalther@gmx.ch> | 2020-10-20 16:37:24 +0200 |
|---|---|---|
| committer | Christian Walther <cwalther@gmx.ch> | 2020-10-20 16:39:32 +0200 |
| commit | 1eab0692b50f05f6b8194897386cda7720634fe6 (patch) | |
| tree | 28dac069ab2540f64bf59fd78351378b9f8dcadc | |
| parent | c5d8c12e342f8fd904bfdbfb1175860bc03f6416 (diff) | |
Fix missing `nproc` on macOS.
396979a breaks building on macOS: `nproc` is a Linux thing, use a cross-platform alternative.
| -rw-r--r-- | ports/atmel-samd/Makefile | 2 | ||||
| -rw-r--r-- | py/mkenv.mk | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 2593377eb..111f12b4e 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -197,7 +197,7 @@ endif LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs -LDFLAGS += -flto=$(shell nproc) +LDFLAGS += -flto=$(shell $(NPROC)) LIBS := -lgcc -lc # Use toolchain libm if we're not using our own. diff --git a/py/mkenv.mk b/py/mkenv.mk index b76dd60f8..cb678e8e7 100644 --- a/py/mkenv.mk +++ b/py/mkenv.mk @@ -55,6 +55,8 @@ PYTHON3 ?= python3 RM = rm RSYNC = rsync SED = sed +# Linux has 'nproc', macOS has 'sysctl -n hw.logicalcpu', this is cross-platform +NPROC = $(PYTHON) -c 'import multiprocessing as mp; print(mp.cpu_count())' AS = $(CROSS_COMPILE)as CC = $(CROSS_COMPILE)gcc |
