aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2015-02-03 20:07:55 +0100
committerLorenz Meier <lm@inf.ethz.ch>2015-02-03 20:07:55 +0100
commitdc46736eadac43527f875b281cc1f50032d36066 (patch)
tree5ee20f8423847161b624fd4f1e943d5a1608d171 /Makefile
parent3e7faa6018dbff54860304a2e1a35d853160ef64 (diff)
parentd441d38677eb78d1e599973dd1e993d3af1af218 (diff)
downloadpx4-firmware-dc46736eadac43527f875b281cc1f50032d36066.tar.gz
px4-firmware-dc46736eadac43527f875b281cc1f50032d36066.tar.bz2
px4-firmware-dc46736eadac43527f875b281cc1f50032d36066.zip
Merge ROS into master
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 30 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index b17859705..af93504ee 100644
--- a/Makefile
+++ b/Makefile
@@ -104,13 +104,13 @@ DESIRED_FIRMWARES = $(foreach config,$(CONFIGS),$(IMAGE_DIR)$(config).px4)
STAGED_FIRMWARES = $(foreach config,$(KNOWN_CONFIGS),$(IMAGE_DIR)$(config).px4)
FIRMWARES = $(foreach config,$(KNOWN_CONFIGS),$(BUILD_DIR)$(config).build/firmware.px4)
-all: checksubmodules $(DESIRED_FIRMWARES)
+all: $(DESIRED_FIRMWARES)
#
# Copy FIRMWARES into the image directory.
#
-# XXX copying the .bin files is a hack to work around the PX4IO uploader
-# not supporting .px4 files, and it should be deprecated onced that
+# XXX copying the .bin files is a hack to work around the PX4IO uploader
+# not supporting .px4 files, and it should be deprecated onced that
# is taken care of.
#
$(STAGED_FIRMWARES): $(IMAGE_DIR)%.px4: $(BUILD_DIR)%.build/firmware.px4
@@ -124,7 +124,7 @@ $(STAGED_FIRMWARES): $(IMAGE_DIR)%.px4: $(BUILD_DIR)%.build/firmware.px4
.PHONY: $(FIRMWARES)
$(BUILD_DIR)%.build/firmware.px4: config = $(patsubst $(BUILD_DIR)%.build/firmware.px4,%,$@)
$(BUILD_DIR)%.build/firmware.px4: work_dir = $(BUILD_DIR)$(config).build/
-$(FIRMWARES): $(BUILD_DIR)%.build/firmware.px4:
+$(FIRMWARES): $(BUILD_DIR)%.build/firmware.px4: checksubmodules generateuorbtopicheaders
@$(ECHO) %%%%
@$(ECHO) %%%% Building $(config) in $(work_dir)
@$(ECHO) %%%%
@@ -152,7 +152,7 @@ $(foreach config,$(FMU_CONFIGS),$(eval $(call FMU_DEP,$(config))))
# Build the NuttX export archives.
#
# Note that there are no explicit dependencies extended from these
-# archives. If NuttX is updated, the user is expected to rebuild the
+# archives. If NuttX is updated, the user is expected to rebuild the
# archives/build area manually. Likewise, when the 'archives' target is
# invoked, all archives are always rebuilt.
#
@@ -226,6 +226,29 @@ updatesubmodules:
$(Q) (git submodule init)
$(Q) (git submodule update)
+MSG_DIR = $(PX4_BASE)msg
+UORB_TEMPLATE_DIR = $(PX4_BASE)msg/templates/uorb
+MULTIPLATFORM_TEMPLATE_DIR = $(PX4_BASE)msg/templates/px4/uorb
+TOPICS_DIR = $(PX4_BASE)src/modules/uORB/topics
+MULTIPLATFORM_HEADER_DIR = $(PX4_BASE)src/platforms/nuttx/px4_messages
+MULTIPLATFORM_PREFIX = px4_
+TOPICHEADER_TEMP_DIR = $(BUILD_DIR)topics_temporary
+GENMSG_PYTHONPATH = $(PX4_BASE)Tools/genmsg/src
+GENCPP_PYTHONPATH = $(PX4_BASE)Tools/gencpp/src
+
+.PHONY: generateuorbtopicheaders
+generateuorbtopicheaders:
+ @$(ECHO) "Generating uORB topic headers"
+ $(Q) (PYTHONPATH=$(GENMSG_PYTHONPATH):$(GENCPP_PYTHONPATH) $(PYTHON) \
+ $(PX4_BASE)Tools/px_generate_uorb_topic_headers.py \
+ -d $(MSG_DIR) -o $(TOPICS_DIR) -e $(UORB_TEMPLATE_DIR) -t $(TOPICHEADER_TEMP_DIR))
+ @$(ECHO) "Generating multiplatform uORB topic wrapper headers"
+ $(Q) (PYTHONPATH=$(GENMSG_PYTHONPATH):$(GENCPP_PYTHONPATH) $(PYTHON) \
+ $(PX4_BASE)Tools/px_generate_uorb_topic_headers.py \
+ -d $(MSG_DIR) -o $(MULTIPLATFORM_HEADER_DIR) -e $(MULTIPLATFORM_TEMPLATE_DIR) -t $(TOPICHEADER_TEMP_DIR) -p $(MULTIPLATFORM_PREFIX))
+# clean up temporary files
+ $(Q) (rm -r $(TOPICHEADER_TEMP_DIR))
+
#
# Testing targets
#
@@ -237,12 +260,12 @@ testbuild:
# Unittest targets. Builds and runs the host-level
# unit tests.
.PHONY: tests
-tests:
+tests: generateuorbtopicheaders
$(Q) (mkdir -p $(PX4_BASE)/unittests/build && cd $(PX4_BASE)/unittests/build && cmake .. && $(MAKE) unittests)
#
# Cleanup targets. 'clean' should remove all built products and force
-# a complete re-compilation, 'distclean' should remove everything
+# a complete re-compilation, 'distclean' should remove everything
# that's generated leaving only files that are in source control.
#
.PHONY: clean