Move generate_psa_constants.py to tf-psa-crypto

This commit moves generate_psa_constants.py to tf-psa-crypto and updates
the paths inside the script necessary for that move.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
diff --git a/programs/Makefile b/programs/Makefile
index b48a006..d2cee1c 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -133,13 +133,13 @@
 GENERATED_FILES = psa/psa_constant_names_generated.c test/query_config.c
 generated_files: $(GENERATED_FILES)
 
-psa/psa_constant_names_generated.c: $(gen_file_dep) ../scripts/generate_psa_constants.py
+psa/psa_constant_names_generated.c: $(gen_file_dep) ../tf-psa-crypto/scripts/generate_psa_constants.py
 psa/psa_constant_names_generated.c: $(gen_file_dep) ../tf-psa-crypto/include/psa/crypto_values.h
 psa/psa_constant_names_generated.c: $(gen_file_dep) ../tf-psa-crypto/include/psa/crypto_extra.h
 psa/psa_constant_names_generated.c: $(gen_file_dep) ../tf-psa-crypto/tests/suites/test_suite_psa_crypto_metadata.data
 psa/psa_constant_names_generated.c:
 	echo "  Gen   $@"
-	$(PYTHON) ../scripts/generate_psa_constants.py
+	cd ../tf-psa-crypto; $(PYTHON) ../scripts/generate_psa_constants.py
 
 test/query_config.c: $(gen_file_dep) ../scripts/generate_query_config.pl
 ## The generated file only depends on the options that are present in mbedtls_config.h,
diff --git a/tf-psa-crypto/programs/psa/CMakeLists.txt b/tf-psa-crypto/programs/psa/CMakeLists.txt
index 3e5daca..625b6e1 100644
--- a/tf-psa-crypto/programs/psa/CMakeLists.txt
+++ b/tf-psa-crypto/programs/psa/CMakeLists.txt
@@ -19,9 +19,9 @@
         WORKING_DIRECTORY
             ${CMAKE_CURRENT_SOURCE_DIR}/../../..
         DEPENDS
-            ${CMAKE_CURRENT_SOURCE_DIR}/../../../scripts/generate_psa_constants.py
-            ${CMAKE_CURRENT_SOURCE_DIR}/../../../tf-psa-crypto/include/psa/crypto_values.h
-            ${CMAKE_CURRENT_SOURCE_DIR}/../../../tf-psa-crypto/include/psa/crypto_extra.h
+            ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/generate_psa_constants.py
+            ${CMAKE_CURRENT_SOURCE_DIR}/../../include/psa/crypto_values.h
+            ${CMAKE_CURRENT_SOURCE_DIR}/../../include/psa/crypto_extra.h
     )
 else()
     link_to_source(psa_constant_names_generated.c)
diff --git a/tf-psa-crypto/scripts/framework_scripts_path.py b/tf-psa-crypto/scripts/framework_scripts_path.py
new file mode 100644
index 0000000..4d4a440
--- /dev/null
+++ b/tf-psa-crypto/scripts/framework_scripts_path.py
@@ -0,0 +1,17 @@
+"""Add our Python library directory to the module search path.
+
+Usage:
+
+    import framework_scripts_path # pylint: disable=unused-import
+"""
+
+# Copyright The Mbed TLS Contributors
+# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
+#
+
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(__file__),
+                             os.path.pardir,
+                             'framework', 'scripts'))
diff --git a/scripts/generate_psa_constants.py b/tf-psa-crypto/scripts/generate_psa_constants.py
similarity index 96%
rename from scripts/generate_psa_constants.py
rename to tf-psa-crypto/scripts/generate_psa_constants.py
index a636363..a22e406 100755
--- a/scripts/generate_psa_constants.py
+++ b/tf-psa-crypto/scripts/generate_psa_constants.py
@@ -1,13 +1,13 @@
 #!/usr/bin/env python3
 
 """Generate psa_constant_names_generated.c
-which is included by tf-psa-crypto/programs/psa/psa_constant_names.c.
+which is included by programs/psa/psa_constant_names.c.
 The code generated by this module is only meant to be used in the context
 of that program.
 
 An argument passed to this script will modify the output directory where the
 file is written:
-* by default (no arguments passed): writes to tf-psa-crypto/programs/psa/
+* by default (no arguments passed): writes to programs/psa/
 * OUTPUT_FILE_DIR passed: writes to OUTPUT_FILE_DIR/
 """
 
@@ -327,8 +327,8 @@
 if __name__ == '__main__':
     build_tree.chdir_to_root()
     # Allow to change the directory where psa_constant_names_generated.c is written to.
-    OUTPUT_FILE_DIR = sys.argv[1] if len(sys.argv) == 2 else "tf-psa-crypto/programs/psa"
+    OUTPUT_FILE_DIR = sys.argv[1] if len(sys.argv) == 2 else "programs/psa"
 
-    generate_psa_constants(['tf-psa-crypto/include/psa/crypto_values.h',
-                            'tf-psa-crypto/include/psa/crypto_extra.h'],
+    generate_psa_constants(['include/psa/crypto_values.h',
+                            'include/psa/crypto_extra.h'],
                            OUTPUT_FILE_DIR + '/psa_constant_names_generated.c')