Doc: Added nested index structure

This patch adjusts the structure of documentation, making it
easier to organise and navigate.

* Modifies index.rst.in decoupled from cmake index.rst.
* Creates respective indexes in the documentation sub-directories
  and links them to the master index
* External component documentation is preserved
* CMAKE build system is updated to automate the document listing
  in the design_documents index instead of the master index.

Change-Id: I697b68e19dc57ecf7f36bc6dd8248fe345bdad61
Signed-off-by: Galanakis, Minos <minos.galanakis@arm.com>
diff --git a/cmake/Common/BuildSphinxDoc.cmake b/cmake/Common/BuildSphinxDoc.cmake
index 74ead01..3aea00f 100644
--- a/cmake/Common/BuildSphinxDoc.cmake
+++ b/cmake/Common/BuildSphinxDoc.cmake
@@ -76,9 +76,10 @@
 	set(SPHINXCFG_TEMPLATE_FILE "${TFM_ROOT_DIR}/docs/conf.py.in")
 	set(SPHINXCFG_CONFIGURED_FILE "${SPHINXCFG_OUTPUT_PATH}/conf.py")
 
-	set(SPHINX_TEMPLATE_INDEX_FILE "${TFM_ROOT_DIR}/docs/index.rst.in")
-	set(SPHINX_CONFIGURED_INDEX_FILE "${SPHINX_TMP_DOC_DIR}/index.rst")
 	set(SPHINX_DESIGN_DOC_ROOT "${TFM_ROOT_DIR}/docs/design_documents")
+	set(SPHINX_TEMPLATE_INDEX_FILE "${SPHINX_DESIGN_DOC_ROOT}/index.rst.in")
+	set(SPHINX_CONFIGURED_INDEX_FILE "${SPHINX_TMP_DOC_DIR}/docs/design_documents/index.rst")
+	set(SPHINX_MAIN_INDEX_FILE "docs/index.rst")
 
 	#Version ID of TF-M.
 	#TODO: this shall not be hard-coded here. We need a process to define the
@@ -111,6 +112,7 @@
 		COMMAND "${CMAKE_COMMAND}" -D TFM_ROOT_DIR=${TFM_ROOT_DIR}
 				-D DST_DIR=${SPHINX_TMP_DOC_DIR}
 				-D BINARY_DIR=${CMAKE_BINARY_DIR}
+				-D MASTER_IDX=${SPHINX_MAIN_INDEX_FILE}
 				-P "${TFM_ROOT_DIR}/cmake/SphinxCopyDoc.cmake"
 		WORKING_DIRECTORY "${TFM_ROOT_DIR}"
 		DEPENDS run-allways