aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-01-14 21:01:58 -0800
committerpx4dev <px4@purgatory.org>2013-01-14 21:01:58 -0800
commit854c6436b4e3b292fd04843795d0369dc8856783 (patch)
tree4d5602f5c70926d2dcd01294561ddd8df4378462 /Makefile
parent6d138a845aabad31060bd00da0d20d177d3f4be4 (diff)
parentc38ad4ded570eddadeeca3579d02dfc63dcc8a9d (diff)
downloadpx4-firmware-854c6436b4e3b292fd04843795d0369dc8856783.tar.gz
px4-firmware-854c6436b4e3b292fd04843795d0369dc8856783.tar.bz2
px4-firmware-854c6436b4e3b292fd04843795d0369dc8856783.zip
Pull NuttX up to the 6.24 release.
Merge branch 'nuttx-merge-5447'
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 19 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index d9469bb49..f91e75d0b 100644
--- a/Makefile
+++ b/Makefile
@@ -28,12 +28,8 @@ UPLOADER = $(PX4BASE)/Tools/px_uploader.py
# What are we currently configured for?
#
CONFIGURED = $(PX4BASE)/.configured
-ifeq ($(wildcard $(CONFIGURED)),)
-# the $(CONFIGURED) target will make this a reality before building
-export TARGET = px4fmu
-$(shell echo $(TARGET) > $(CONFIGURED))
-else
-export TARGET = $(shell cat $(CONFIGURED))
+ifneq ($(wildcard $(CONFIGURED)),)
+export TARGET := $(shell cat $(CONFIGURED))
endif
#
@@ -59,12 +55,13 @@ $(FIRMWARE_BUNDLE): $(FIRMWARE_BINARY) $(MKFW) $(FIRMWARE_PROTOTYPE)
@$(MKFW) --prototype $(FIRMWARE_PROTOTYPE) \
--git_identity $(PX4BASE) \
--image $(FIRMWARE_BINARY) > $@
+
#
# Build the firmware binary.
#
.PHONY: $(FIRMWARE_BINARY)
-$(FIRMWARE_BINARY): configure_$(TARGET) setup_$(TARGET)
- @echo Building $@
+$(FIRMWARE_BINARY): setup_$(TARGET) configure-check
+ @echo Building $@ for $(TARGET)
@make -C $(NUTTX_SRC) -r $(MQUIET) all
@cp $(NUTTX_SRC)/nuttx.bin $@
@@ -73,19 +70,26 @@ $(FIRMWARE_BINARY): configure_$(TARGET) setup_$(TARGET)
# and makes it current.
#
configure_px4fmu:
-ifneq ($(TARGET),px4fmu)
+ @echo Configuring for px4fmu
@make -C $(PX4BASE) distclean
-endif
@cd $(NUTTX_SRC)/tools && /bin/sh configure.sh px4fmu/nsh
@echo px4fmu > $(CONFIGURED)
configure_px4io:
-ifneq ($(TARGET),px4io)
+ @echo Configuring for px4io
@make -C $(PX4BASE) distclean
-endif
@cd $(NUTTX_SRC)/tools && /bin/sh configure.sh px4io/io
@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
+
+
#
# Per-configuration additional targets
#
@@ -96,6 +100,9 @@ setup_px4fmu:
setup_px4io:
+# fake target to make configure-check happy if TARGET is not set
+setup_:
+
#
# Firmware uploading.
#