Add support for compiling in-tree TAs

Adds support for compiling in-tree TAs. Unless specified via
CFG_USER_TA_TARGET_<ta-name> the TA will be built with the first TA
target (aka TA dev kit, when delivered) specified in the variable
ta-targets which is initialized in core/arch/arm/plat-*/conf.mk.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/Makefile b/Makefile
index 7caab01..c3c2698 100644
--- a/Makefile
+++ b/Makefile
@@ -74,6 +74,7 @@
 
 # Platform config is supposed to assign the targets
 ta-targets ?= user_ta
+default-user-ta-target ?= $(firstword $(ta-targets))
 
 ifeq ($(CFG_WITH_USER_TA),y)
 define build-ta-target
@@ -81,6 +82,13 @@
 include ta/ta.mk
 endef
 $(foreach t, $(ta-targets), $(eval $(call build-ta-target, $(t))))
+
+# Build user TAs included in this git
+define build-user-ta
+ta-mk-file := $(1)
+include ta/mk/build-user-ta.mk
+endef
+$(foreach t, $(wildcard ta/*/user_ta.mk), $(eval $(call build-user-ta,$(t))))
 endif
 
 include mk/cleandirs.mk