Move parallel flag into makefile with crossplatform support

This commit is contained in:
George Hahn 2022-05-10 00:37:37 -06:00
parent 0269681ac3
commit 0ab63691f2
2 changed files with 13 additions and 2 deletions

11
make.mk
View file

@ -29,6 +29,17 @@ else
MKDIR = mkdir
endif
ifeq ($(DETECTED_OS), LINUX)
MAKEFLAGS += -j `nproc`
endif
ifeq ($(DETECTED_OS), OSX)
NPROCS = $(shell sysctl hw.ncpu | grep -o '[0-9]\+')
MAKEFLAGS += -j $(NPROCS)
endif
ifeq ($(DETECTED_OS), WINDOWS)
MAKEFLAGS += -j $(NUMBER_OF_PROCESSORS)
endif
ifndef EMSCRIPTEN
CC = arm-none-eabi-gcc
OBJCOPY = arm-none-eabi-objcopy

View file

@ -22,11 +22,11 @@ do
do
COLOR=$(echo "$color" | tr '[:lower:]' '[:upper:]')
make clean
make LED=$COLOR FIRMWARE=$VARIANT -j `nproc`
make LED=$COLOR FIRMWARE=$VARIANT
mv "build/watch.uf2" "$fw_dir/$variant-$color.uf2"
done
make clean
emmake make FIRMWARE=$VARIANT -j `nproc`
emmake make FIRMWARE=$VARIANT
mkdir "$sim_dir/$variant/"
mv "build/watch.wasm" "$sim_dir/$variant/"
mv "build/watch.js" "$sim_dir/$variant/"