From 8440e4f70907e87661e295f1585208620d68b84e Mon Sep 17 00:00:00 2001 From: px4dev Date: Wed, 16 Jan 2013 22:38:47 -0800 Subject: Simplify the PLATFORM/CONFIG handling a little. --- makefiles/firmware.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'makefiles/firmware.mk') diff --git a/makefiles/firmware.mk b/makefiles/firmware.mk index c85c5c919..cde646036 100644 --- a/makefiles/firmware.mk +++ b/makefiles/firmware.mk @@ -74,11 +74,15 @@ RMDIR = rm -rf # # Sanity-check the PLATFORM variable and then get the platform config. +# If PLATFORM is not set, but CONFIG is, use that. # # The platform config in turn will fetch the toolchain configuration. # ifeq ($(PLATFORM),) -$(error The PLATFORM variable must be set before including firmware.mk) +ifeq ($(CONFIG),) +$(error At least one of the PLATFORM or CONFIG variables must be set before including firmware.mk) +endif +PLATFORM := $(firstword $(subst _, ,$(CONFIG))) endif include $(PX4_MK_INCLUDE)/$(PLATFORM).mk -- cgit v1.2.3