build(tf-a-tests): add conditional platform check

This change adds a check that verifies if a platform supports
el3_payload before building it

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Ibb8b871224ed24f0ea678cdb8f4d490849dea87c
diff --git a/Makefile b/Makefile
index 6d0774e..738a926 100644
--- a/Makefile
+++ b/Makefile
@@ -94,6 +94,10 @@
   $(error "Error: Invalid platform. The following platforms are available: ${PLATFORMS}")
 endif
 
+
+EL3_PAYLOAD_PLAT_PATH		:=	$(shell find el3_payload/plat/ -wholename '*/${PLAT}')
+EL3_PAYLOAD_PLAT_MAKEFILE_FULL	:=	${EL3_PAYLOAD_PLAT_PATH}/${PLAT_MAKEFILE}
+
 .PHONY: all
 all: msg_start
 
@@ -531,12 +535,14 @@
 # system.
 .PHONY: el3_payload
 ifneq (${ARCH},aarch32)
+ifneq ($(wildcard ${EL3_PAYLOAD_PLAT_MAKEFILE_FULL}),)
 el3_payload: $(BUILD_DIR)
 	${Q}${MAKE} -C el3_payload PLAT=${PLAT}
 	${Q}find "el3_payload/build/${PLAT}" -name '*.bin' -exec cp {} "${BUILD_PLAT}" \;
 
 all: el3_payload
 endif
+endif
 
 doc:
 	@echo "  BUILD DOCUMENTATION"