mk: fixed dependency on mavlink header generation

This commit is contained in:
Andrew Tridgell 2016-01-15 07:44:15 +11:00
parent ff02adf57e
commit f6c2b55c3f
4 changed files with 10 additions and 13 deletions

View File

@ -64,7 +64,7 @@ LIBSKETCH_SKEL_SO = $(BUILDROOT)/libqflight_skel.so
.SUFFIXES: .o .c .cpp .so .do
# build DSP object from C file
$(BUILDROOT)/libraries/%.do: $(SKETCHBOOK)/libraries/%.c MAV_GEN
$(BUILDROOT)/libraries/%.do: $(SKETCHBOOK)/libraries/%.c $(MAVLINK_HEADERS)
$(RULEHDR)
$(v)$(QURT_CC) $(DSP_FLAGS) -c -o $@ $<

View File

@ -3,11 +3,11 @@
# Build sketch objects
#
$(BUILDROOT)/%.o: $(BUILDROOT)/%.cpp $(GENERATE_TARGETS) MAV_GEN
$(BUILDROOT)/%.o: $(BUILDROOT)/%.cpp $(GENERATE_TARGETS) $(MAVLINK_HEADERS)
$(RULEHDR)
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< $(SKETCH_INCLUDES)
$(BUILDROOT)/%.o: $(BUILDROOT)/make.flags $(SRCROOT)/%.cpp $(GENERATE_TARGETS) MAV_GEN
$(BUILDROOT)/%.o: $(BUILDROOT)/make.flags $(SRCROOT)/%.cpp $(GENERATE_TARGETS) $(MAVLINK_HEADERS)
$(RULEHDR)
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $*.cpp $(SKETCH_INCLUDES)
@ -23,7 +23,7 @@ $(BUILDROOT)/%.o: $(SRCROOT)/%.S
# Build library objects from sources in the sketchbook
#
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.cpp $(GENERATE_TARGETS) MAV_GEN
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.cpp $(GENERATE_TARGETS) $(MAVLINK_HEADERS)
$(RULEHDR)
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< $(SLIB_INCLUDES)

View File

@ -2,14 +2,11 @@
# mavlink header generation
MAVLINK_DIR := $(SKETCHBOOK)/modules/mavlink/
MESSAGE_DEFINITIONS := $(SKETCHBOOK)/modules/mavlink/message_definitions/v1.0
MAVLINK_HEADERS := $(BUILDROOT)/libraries/GCS_MAVLink/include/mavlink/v1.0/
.PHONY: MAV_GEN
MAV_GEN: $(MAVLINK_HEADERS) CHECK_MODULES
MAVLINK_HEADERS := $(BUILDROOT)/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink.h $(wildcard $(BUILDROOT)/libraries/GCS_MAVLink/include/mavlink/v1.0/,*.h) $(wildcard $(BUILDROOT)/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega,*.h)
MAVLINK_OUTPUT_DIR := $(BUILDROOT)/libraries/GCS_MAVLink/include/mavlink/v1.0
$(MAVLINK_HEADERS): $(MESSAGE_DEFINITIONS)/ardupilotmega.xml $(MESSAGE_DEFINITIONS)/common.xml
echo "Generating MAVLink headers..."
#goto mavlink module directory and run the most recent generator script
echo "Generating C code using mavgen.py located at" $(SKETCHBOOK)/modules/mavlink/
PYTHONPATH=$(MAVLINK_DIR) python $(MAVLINK_DIR)/pymavlink/tools/mavgen.py --lang=C --wire-protocol=1.0 --output=$@ $(MAVLINK_DIR)/message_definitions/v1.0/ardupilotmega.xml
PYTHONPATH=$(MAVLINK_DIR) python $(MAVLINK_DIR)/pymavlink/tools/mavgen.py --lang=C --wire-protocol=1.0 --output=$(MAVLINK_OUTPUT_DIR) $(MAVLINK_DIR)/message_definitions/v1.0/ardupilotmega.xml

View File

@ -81,7 +81,7 @@ module_mk:
$(v) cmp $(SKETCHBOOK)/module.mk $(SKETCHBOOK)/module.mk.new 2>/dev/null || mv $(SKETCHBOOK)/module.mk.new $(SKETCHBOOK)/module.mk
$(v) rm -f $(SKETCHBOOK)/module.mk.new
px4-v1: $(BUILDROOT)/make.flags CHECK_MODULES MAV_GEN $(PX4_ROOT)/Archives/px4fmu-v1.export $(SKETCHCPP) module_mk px4-io-v1
px4-v1: $(BUILDROOT)/make.flags CHECK_MODULES $(MAVLINK_HEADERS) $(PX4_ROOT)/Archives/px4fmu-v1.export $(SKETCHCPP) module_mk px4-io-v1
$(RULEHDR)
$(v) rm -f $(PX4_ROOT)/makefiles/$(PX4_V1_CONFIG_FILE)
$(v) cp $(PX4_V1_CONFIG_FILE) $(PX4_ROOT)/makefiles/nuttx/
@ -92,7 +92,7 @@ px4-v1: $(BUILDROOT)/make.flags CHECK_MODULES MAV_GEN $(PX4_ROOT)/Archives/px4fm
$(v) $(SKETCHBOOK)/Tools/scripts/add_git_hashes.py $(HASHADDER_FLAGS) "$(SKETCH)-v1.px4" "$(SKETCH)-v1.px4"
$(v) echo "PX4 $(SKETCH) Firmware is in $(SKETCH)-v1.px4"
px4-v2: $(BUILDROOT)/make.flags CHECK_MODULES MAV_GEN $(PX4_ROOT)/Archives/px4fmu-v2.export $(SKETCHCPP) module_mk px4-io-v2
px4-v2: $(BUILDROOT)/make.flags CHECK_MODULES $(MAVLINK_HEADERS) $(PX4_ROOT)/Archives/px4fmu-v2.export $(SKETCHCPP) module_mk px4-io-v2
$(RULEHDR)
$(v) rm -f $(PX4_ROOT)/makefiles/$(PX4_V2_CONFIG_FILE)
$(v) cp $(PX4_V2_CONFIG_FILE) $(PX4_ROOT)/makefiles/nuttx/
@ -103,7 +103,7 @@ px4-v2: $(BUILDROOT)/make.flags CHECK_MODULES MAV_GEN $(PX4_ROOT)/Archives/px4fm
$(v) $(SKETCHBOOK)/Tools/scripts/add_git_hashes.py $(HASHADDER_FLAGS) "$(SKETCH)-v2.px4" "$(SKETCH)-v2.px4"
$(v) echo "PX4 $(SKETCH) Firmware is in $(SKETCH)-v2.px4"
px4-v4: $(BUILDROOT)/make.flags CHECK_MODULES MAV_GEN $(PX4_ROOT)/Archives/px4fmu-v4.export $(SKETCHCPP) module_mk
px4-v4: $(BUILDROOT)/make.flags CHECK_MODULES $(MAVLINK_HEADERS) $(PX4_ROOT)/Archives/px4fmu-v4.export $(SKETCHCPP) module_mk
$(RULEHDR)
$(v) rm -f $(PX4_ROOT)/makefiles/$(PX4_V4_CONFIG_FILE)
$(v) cp $(PX4_V4_CONFIG_FILE) $(PX4_ROOT)/makefiles/nuttx/