Support PLATFORM=<platform>-<flavor>

When $(PLATFORM) contains a hyphen, parse it as
$(PLATFORM)-$(PLATFORM_FLAVOR). Then, one can use:
$ make PLATFORM=vexpress-fvp ...
instead of:
$ make PLATFORM=vexpress PLATFORM_FLAVOR=fvp ...

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
diff --git a/Makefile b/Makefile
index 904735f..10de94d 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,13 @@
 .PHONY: mem_usage
 mem_usage:
 
+# If $(PLATFORM) is defined and contains a hyphen, parse it as
+# $(PLATFORM)-$(PLATFORM_FLAVOR) for convenience
+ifneq (,$(findstring -,$(PLATFORM)))
+ops := $(join PLATFORM PLATFORM_FLAVOR,$(addprefix =,$(subst -, ,$(PLATFORM))))
+$(foreach op,$(ops),$(eval override $(op)))
+endif
+
 # Make these default for now
 ARCH            ?= arm32
 PLATFORM        ?= stm