create a coverity builder
The Coverity Scanner requires a 'platform builder' which in this case,
it is a makefile (cov-makefile) that take cares of platform
compilation under the trusted-firmware-m folder. The compiled files
are the only source files scanned by Coverity, thus the more platforms
included on the platform builder, the better is the static check
scan. So far, the only platform considered is mps2/an521 but much more
are desired as explained above.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
Change-Id: If8ce6a70e8568c5e8b0116555b20377855ac9a55
diff --git a/script/tf-coverity/cov-makefile b/script/tf-coverity/cov-makefile
new file mode 100644
index 0000000..5fb30e9
--- /dev/null
+++ b/script/tf-coverity/cov-makefile
@@ -0,0 +1,38 @@
+#
+# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+# $(call build-platform,platform,toolchain)
+define build-platform
+ mkdir $(BASE_DIR)/$(tf_m)/cmake_build
+ cd $(BASE_DIR)/$(tf_m)/cmake_build && \
+ cmake .. -DTFM_PLATFORM=$1 -DTFM_TOOLCHAIN_FILE=../$2
+
+ cd $(BASE_DIR)/$(tf_m)/cmake_build && \
+ make install
+endef
+
+BASE_DIR ?= .
+
+# TODO: include other platforms to increase coverity coverage
+gnuarm_target_platforms := mps2/an521
+tf_m := trusted-firmware-m
+
+all: $(gnuarm_target_platforms)
+
+$(gnuarm_target_platforms): check msg
+ $(call build-platform,$@,toolchain_GNUARM.cmake)
+
+.phony: check
+check:
+ifndef BASE_DIR
+ echo "please provide a environment BASE_DIR"
+ exit 1
+endif
+ echo "base directory $(BASE_DIR)"
+
+.phony: msg
+msg:
+ echo "building platform"