From cdae9fa77b33eeee17f9b3f5a4d04f1e79a408cd Mon Sep 17 00:00:00 2001 From: Gautier Hattenberger Date: Wed, 22 Jan 2025 17:46:12 +0100 Subject: [PATCH] [makefile] don't build mavlink if required packages are missing (#3421) This is a temporary measure to compile or not on ubuntu 24.04 until the mavlink submodule is updated and integrate the required adaption to cope with deprecated packages --- sw/ext/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sw/ext/Makefile b/sw/ext/Makefile index a614add8a9..fae462be92 100644 --- a/sw/ext/Makefile +++ b/sw/ext/Makefile @@ -32,6 +32,8 @@ EXT_DIR=$(PAPARAZZI_SRC)/sw/ext # include $(PAPARAZZI_SRC)/conf/Makefile.arm-embedded-toolchain +MY_PYTHON := $(shell echo `which python3`) +MY_MAVLINKTOOLS := $(shell $(MY_PYTHON) -c 'import imp; import future' 2>&1) all: libopencm3 luftboot chibios fatfs libsbp TRICAL hacl-c key_generator rustlink ecl matrix mavlink @@ -90,9 +92,13 @@ matrix: matrix.update mavlink: mavlink.update mavlink.build mavlink.build: +ifneq ($(findstring ModuleNotFoundError, $(MY_MAVLINKTOOLS)),ModuleNotFoundError) @echo GENERATE $(PAPARAZZI_SRC)/var/include/mavlink $(Q)PYTHONPATH=$(EXT_DIR)/mavlink python $(EXT_DIR)/mavlink/pymavlink/tools/mavgen.py --output $(PAPARAZZI_SRC)/var/include/mavlink --lang C $(EXT_DIR)/mavlink/message_definitions/v1.0/ardupilotmega.xml --wire-protocol 2.0 --no-validate > /dev/null $(Q)PYTHONPATH=$(EXT_DIR)/mavlink python $(EXT_DIR)/mavlink/pymavlink/tools/mavgen.py --output $(PAPARAZZI_SRC)/var/include/mavlink --lang C $(EXT_DIR)/mavlink/message_definitions/v1.0/paparazzi.xml --wire-protocol 2.0 --no-validate > /dev/null +else + @echo mavlink not installed, missing packages 'imp' or 'future' +endif libsbp: libsbp.update