Docs: Deprecate 'build_docs' folder

With the prefix 'build', user may delete 'build_docs' accidentally.
Deprecate 'build_docs' folder and move the only files 'conf.py' to
'docs' folder.

Change-Id: I701e279861afdc9b0f6cfd10b343643acd77e51d
Signed-off-by: Shawn Shan <Shawn.Shan@arm.com>
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 85f63f0..950f49b 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -36,8 +36,8 @@
 )
 add_custom_command(OUTPUT ${SPHINX_TMP_DOC_DIR}/conf.py
     COMMAND ${CMAKE_COMMAND} -E make_directory ${SPHINX_TMP_DOC_DIR}
-    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/build_docs/conf.py ${SPHINX_TMP_DOC_DIR}/conf.py
-    MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/build_docs/conf.py
+    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/docs/conf.py ${SPHINX_TMP_DOC_DIR}/conf.py
+    MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/docs/conf.py
     BYPRODUCTS ${SPHINX_TMP_DOC_DIR}
 )
 
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..5a83618
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,32 @@
+# -----------------------------------------------------------------------------
+# Copyright (c) 2020, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# -----------------------------------------------------------------------------
+#
+# Configuration file override for the Sphinx documentation builder.
+#
+# This file is used when Sphinx build is  invoked directly at this level.
+# It will trigger a copy-files operation and render a new configuration
+# using either auto-detected or cmake provided  parameters.
+import os
+import sys
+
+# Attempt to find the tools directory by recursing up to five levels of parents
+root_path = os.path.dirname(os.path.abspath(__file__))
+
+for i in range(5):
+    root_path = os.path.dirname(root_path)
+    doc_path = os.path.join(root_path, "tools", "documentation")
+    if os.path.isdir(doc_path):
+        sys.path.insert(0, os.path.abspath(doc_path))
+sys.path.append("./")
+
+# Trigger the copy operation logic
+import tfm_copy_files
+
+# Import the rendered configuration into global scope
+from tfm_cmake_defaults import *
+
+from conf_rendered import *
diff --git a/docs/getting_started/tfm_build_instruction.rst b/docs/getting_started/tfm_build_instruction.rst
index 5576327..cdfcab5 100644
--- a/docs/getting_started/tfm_build_instruction.rst
+++ b/docs/getting_started/tfm_build_instruction.rst
@@ -440,7 +440,10 @@
 .. code-block:: bash
 
     # Build the documentation from build_docs directory
-    cd <TF-M base folder>/ build_docs/
+    cd <TF-M base folder>
+    mkdir build_docs
+    cp docs/conf.py build_docs/conf.py
+    cd build_docs
     sphinx-build ./ user_guide
 
     # Build the documentation from a custom location