forked from Archive/PX4-Autopilot
Makefile: check for 'replay' env variable and change build dir accordingly
For replay with the new logger, we want a separate build dir so that the parameters file and orb rules don't get mixed up.
This commit is contained in:
parent
80134d2b7d
commit
e9726af54c
13
Makefile
13
Makefile
|
@ -104,14 +104,21 @@ endif
|
||||||
PX4_MAKE_ARGS = -j$(j) --no-print-directory
|
PX4_MAKE_ARGS = -j$(j) --no-print-directory
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# check if replay env variable is set & set build dir accordingly
|
||||||
|
ifdef replay
|
||||||
|
BUILD_DIR_SUFFIX := _replay
|
||||||
|
else
|
||||||
|
BUILD_DIR_SUFFIX :=
|
||||||
|
endif
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# describe how to build a cmake config
|
# describe how to build a cmake config
|
||||||
define cmake-build
|
define cmake-build
|
||||||
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(PWD)/build_$@/Makefile ]; then rm -rf $(PWD)/build_$@; fi
|
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(PWD)/build_$@$(BUILD_DIR_SUFFIX)/Makefile ]; then rm -rf $(PWD)/build_$@$(BUILD_DIR_SUFFIX); fi
|
||||||
+@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then Tools/check_submodules.sh && mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) || (cd .. && rm -rf $(PWD)/build_$@); fi
|
+@if [ ! -e $(PWD)/build_$@$(BUILD_DIR_SUFFIX)/CMakeCache.txt ]; then Tools/check_submodules.sh && mkdir -p $(PWD)/build_$@$(BUILD_DIR_SUFFIX) && cd $(PWD)/build_$@$(BUILD_DIR_SUFFIX) && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) || (cd .. && rm -rf $(PWD)/build_$@$(BUILD_DIR_SUFFIX)); fi
|
||||||
+@Tools/check_submodules.sh
|
+@Tools/check_submodules.sh
|
||||||
+@(echo "PX4 CONFIG: $@" && cd $(PWD)/build_$@ && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
|
+@(echo "PX4 CONFIG: $@$(BUILD_DIR_SUFFIX)" && cd $(PWD)/build_$@$(BUILD_DIR_SUFFIX) && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define cmake-build-other
|
define cmake-build-other
|
||||||
|
|
Loading…
Reference in New Issue