mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-27 08:55:51 +08:00
[build] parallel build for firmwares
on OSX using sysctl seems to be faster than using system_profile and also more robust (output is not named differently)
This commit is contained in:
+16
-2
@@ -56,6 +56,20 @@ else
|
||||
MKTEMP = mktemp
|
||||
endif
|
||||
|
||||
# detection of number of processors for parallel compilation
|
||||
# can be overridden by calling toplevel make with e.g. J=2
|
||||
NPROCS := 1
|
||||
ifeq ($J,)
|
||||
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
|
||||
NPROCS := $J
|
||||
endif # $J
|
||||
|
||||
|
||||
# "make Q=''" to get full echo
|
||||
Q=@
|
||||
|
||||
@@ -176,8 +190,8 @@ $(SETTINGS_TELEMETRY) : $(PERIODIC_H)
|
||||
@echo BUILD $(AIRCRAFT), TARGET $*
|
||||
$(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) TARGET=$* Q=$(Q) $(GENERATORS)/gen_aircraft.out $(AIRCRAFT)
|
||||
|
||||
%.compile: %.ac_h print_version
|
||||
cd $(AIRBORNE); $(MAKE) TARGET=$* all
|
||||
%.compile: %.ac_h | print_version
|
||||
cd $(AIRBORNE); $(MAKE) -j$(NPROCS) TARGET=$* all
|
||||
|
||||
%.upload: %.compile
|
||||
cd $(AIRBORNE); $(MAKE) TARGET=$* upload
|
||||
|
||||
Reference in New Issue
Block a user