mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-27 00:37:37 +08:00
[build] only build firmware in parallel with J=AUTO
by passing J=AUTO from toplevel make it will auto-detect the number of CPUs Number of processes can also be explicitly set with e.g. J=4 Calling make without a J variable is the same as J=1 (serial compilation)
This commit is contained in:
+7
-3
@@ -57,17 +57,21 @@ else
|
||||
endif
|
||||
|
||||
# detection of number of processors for parallel compilation
|
||||
# can be overridden by calling toplevel make with e.g. J=2
|
||||
# by passing J=AUTO from toplevel make.
|
||||
# Number of processes can also be explicitly set with e.g. J=4
|
||||
# Calling make without a J variable is the same as J=1 (serial compilation)
|
||||
NPROCS := 1
|
||||
ifeq ($J,)
|
||||
ifdef J
|
||||
ifeq ($J,AUTO)
|
||||
ifeq ($(UNAME),Linux)
|
||||
NPROCS := $(shell grep -c ^processor /proc/cpuinfo)
|
||||
else ifeq ($(UNAME),Darwin)
|
||||
NPROCS := $(shell sysctl hw.ncpu | awk '{print $$2}')
|
||||
endif # $(UNAME)
|
||||
else
|
||||
else # not auto, explicitly specified
|
||||
NPROCS := $J
|
||||
endif # $J
|
||||
endif
|
||||
|
||||
|
||||
# "make Q=''" to get full echo
|
||||
|
||||
Reference in New Issue
Block a user