docs: Decouple refrences from /docs folder
Signed-off-by: Anton Komlev <anton.komlev@arm.com>
Change-Id: I1955201382074eb9e6dd80aadbc456eb09aecb22
diff --git a/tools/documentation/tfm_cmake_defaults.py b/tools/documentation/tfm_cmake_defaults.py
index 0acfbc8..1820b6a 100644
--- a/tools/documentation/tfm_cmake_defaults.py
+++ b/tools/documentation/tfm_cmake_defaults.py
@@ -171,7 +171,7 @@
# Documentation base path
tfm_def_doc_root = os.path.join(tfm_def_root_dir, "docs")
- tfm_def_copy_doc_root = os.path.join(tfm_def_copy_dir, "docs")
+ tfm_def_copy_doc_root = tfm_def_copy_dir
# Disable copyfiles for next invocation
cmake_env["SPHINXCFG_COPY_FILES"] = "False"
diff --git a/tools/documentation/tfm_copy_files.py b/tools/documentation/tfm_copy_files.py
index 09226c8..b1eb9b0 100644
--- a/tools/documentation/tfm_copy_files.py
+++ b/tools/documentation/tfm_copy_files.py
@@ -19,6 +19,16 @@
from tfm_cmake_defaults import *
from subprocess import call
+def copytree_overwrite(src, dest):
+ if os.path.isdir(src):
+ if not os.path.isdir(dest):
+ os.makedirs(dest)
+ files = os.listdir(src)
+ for f in files:
+ copytree_overwrite(os.path.join(src, f),
+ os.path.join(dest, f))
+ else:
+ copy2(src, dest)
def tfm_copy_files():
doc_files = []
@@ -51,11 +61,7 @@
rmtree(f)
# Copy the documentation folder as is
- copytree(tfm_def_doc_root, tfm_def_copy_doc_root)
-
- # Move the index to the intermediate build directory
- # docs/index.rst --> ./index.rst
- move(os.path.join(tfm_def_copy_doc_root, "index.rst"), tfm_def_copy_dir)
+ copytree_overwrite(tfm_def_doc_root, tfm_def_copy_doc_root)
for df in list(doc_files):
# Set the target filename to be cwd + relative to root path of origin