forked from Archive/PX4-Autopilot
Support parallel building through -j flag in makefile.
This commit is contained in:
parent
68a78b0580
commit
54f8dd2f4d
5
Makefile
5
Makefile
|
@ -54,13 +54,14 @@
|
|||
# rest are arguments to pass to the makefile generated
|
||||
# by cmake in the subdirectory
|
||||
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
||||
j ?= 1
|
||||
|
||||
# Functions
|
||||
# --------------------------------------------------------------------
|
||||
# define a make function to describe how to build a cmake config
|
||||
define cmake-build
|
||||
mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -DCONFIG=$(1)
|
||||
make -C $(PWD)/build_$@ -s $(ARGS)
|
||||
+mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -DCONFIG=$(1)
|
||||
+make -C $(PWD)/build_$@ --no-print-directory $(ARGS)
|
||||
endef
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue