mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 02:16:53 +08:00
Merge branch 'nuttx-merge-0f2decb' into nuttx-merge-5447
This commit is contained in:
@@ -28,13 +28,7 @@ UPLOADER = $(PX4BASE)/Tools/px_uploader.py
|
|||||||
# What are we currently configured for?
|
# What are we currently configured for?
|
||||||
#
|
#
|
||||||
CONFIGURED = $(PX4BASE)/.configured
|
CONFIGURED = $(PX4BASE)/.configured
|
||||||
ifeq ($(wildcard $(CONFIGURED)),)
|
export TARGET := $(shell cat $(CONFIGURED))
|
||||||
# the $(CONFIGURED) target will make this a reality before building
|
|
||||||
export TARGET = px4fmu
|
|
||||||
$(shell echo $(TARGET) > $(CONFIGURED))
|
|
||||||
else
|
|
||||||
export TARGET = $(shell cat $(CONFIGURED))
|
|
||||||
endif
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# What we will build
|
# What we will build
|
||||||
@@ -59,12 +53,13 @@ $(FIRMWARE_BUNDLE): $(FIRMWARE_BINARY) $(MKFW) $(FIRMWARE_PROTOTYPE)
|
|||||||
@$(MKFW) --prototype $(FIRMWARE_PROTOTYPE) \
|
@$(MKFW) --prototype $(FIRMWARE_PROTOTYPE) \
|
||||||
--git_identity $(PX4BASE) \
|
--git_identity $(PX4BASE) \
|
||||||
--image $(FIRMWARE_BINARY) > $@
|
--image $(FIRMWARE_BINARY) > $@
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build the firmware binary.
|
# Build the firmware binary.
|
||||||
#
|
#
|
||||||
.PHONY: $(FIRMWARE_BINARY)
|
.PHONY: $(FIRMWARE_BINARY)
|
||||||
$(FIRMWARE_BINARY): configure_$(TARGET) setup_$(TARGET)
|
$(FIRMWARE_BINARY): setup_$(TARGET) configure-check
|
||||||
@echo Building $@
|
@echo Building $@ for $(TARGET)
|
||||||
@make -C $(NUTTX_SRC) -r $(MQUIET) all
|
@make -C $(NUTTX_SRC) -r $(MQUIET) all
|
||||||
@cp $(NUTTX_SRC)/nuttx.bin $@
|
@cp $(NUTTX_SRC)/nuttx.bin $@
|
||||||
|
|
||||||
@@ -73,19 +68,26 @@ $(FIRMWARE_BINARY): configure_$(TARGET) setup_$(TARGET)
|
|||||||
# and makes it current.
|
# and makes it current.
|
||||||
#
|
#
|
||||||
configure_px4fmu:
|
configure_px4fmu:
|
||||||
ifneq ($(TARGET),px4fmu)
|
@echo Configuring for px4fmu
|
||||||
@make -C $(PX4BASE) distclean
|
@make -C $(PX4BASE) distclean
|
||||||
@cd $(NUTTX_SRC)/tools && /bin/sh configure.sh px4fmu/nsh
|
@cd $(NUTTX_SRC)/tools && /bin/sh configure.sh px4fmu/nsh
|
||||||
@echo px4fmu > $(CONFIGURED)
|
@echo px4fmu > $(CONFIGURED)
|
||||||
endif
|
|
||||||
|
|
||||||
configure_px4io:
|
configure_px4io:
|
||||||
ifneq ($(TARGET),px4io)
|
@echo Configuring for px4io
|
||||||
@make -C $(PX4BASE) distclean
|
@make -C $(PX4BASE) distclean
|
||||||
@cd $(NUTTX_SRC)/tools && /bin/sh configure.sh px4io/io
|
@cd $(NUTTX_SRC)/tools && /bin/sh configure.sh px4io/io
|
||||||
@echo px4io > $(CONFIGURED)
|
@echo px4io > $(CONFIGURED)
|
||||||
|
|
||||||
|
configure-check:
|
||||||
|
ifeq ($(wildcard $(CONFIGURED)),)
|
||||||
|
@echo
|
||||||
|
@echo "Not configured - use 'make configure_px4fmu' or 'make configure_px4io' first"
|
||||||
|
@echo
|
||||||
|
@exit 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Per-configuration additional targets
|
# Per-configuration additional targets
|
||||||
#
|
#
|
||||||
@@ -96,6 +98,9 @@ setup_px4fmu:
|
|||||||
|
|
||||||
setup_px4io:
|
setup_px4io:
|
||||||
|
|
||||||
|
# fake target to make configure-check happy if TARGET is not set
|
||||||
|
setup_:
|
||||||
|
|
||||||
#
|
#
|
||||||
# Firmware uploading.
|
# Firmware uploading.
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user