Adjust build systems

Adjust build systems such as we can built
Mbed TLS in the default and full configuration.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index 9b26b6b..e2562df 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -129,19 +129,22 @@
 if(GEN_FILES)
     find_package(Perl REQUIRED)
 
-    file(GLOB error_headers ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/*.h)
+    file(GLOB crypto_error_headers ${CMAKE_CURRENT_SOURCE_DIR}/../tf-psa-crypto/drivers/builtin/include/mbedtls/*.h)
+    file(GLOB tls_error_headers ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/*.h)
     add_custom_command(
         OUTPUT
             ${CMAKE_CURRENT_BINARY_DIR}/error.c
         COMMAND
             ${PERL_EXECUTABLE}
                 ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_errors.pl
+                ${CMAKE_CURRENT_SOURCE_DIR}/../tf-psa-crypto/drivers/builtin/include/mbedtls
                 ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls
                 ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data_files
                 ${CMAKE_CURRENT_BINARY_DIR}/error.c
         DEPENDS
             ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_errors.pl
-            ${error_headers}
+            ${crypto_error_headers}
+            ${tls_error_headers}
             ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data_files/error.fmt
     )
 
@@ -170,7 +173,7 @@
                 ${CMAKE_CURRENT_BINARY_DIR}
         DEPENDS
             ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_ssl_debug_helpers.py
-            ${error_headers}
+            ${tls_error_headers}
     )
 
     add_custom_command(
@@ -329,6 +332,7 @@
     target_include_directories(${target}
         PUBLIC $<BUILD_INTERFACE:${MBEDTLS_DIR}/include/>
                $<BUILD_INTERFACE:${MBEDTLS_DIR}/tf-psa-crypto/include/>
+               $<BUILD_INTERFACE:${MBEDTLS_DIR}/tf-psa-crypto/drivers/builtin/include/>
                $<INSTALL_INTERFACE:include/>
         PRIVATE ${MBEDTLS_DIR}/library/
                 # Needed to include psa_crypto_driver_wrappers.h
diff --git a/library/Makefile b/library/Makefile
index 014e0ca..5b18e3a 100644
--- a/library/Makefile
+++ b/library/Makefile
@@ -28,11 +28,13 @@
 WARNING_CFLAGS ?=  -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
 LDFLAGS ?=
 
-# Include ../include, ../tf-psa-crypto/include for public headers and . for
+# Include ../include, ../tf-psa-crypto/include and
+# ../tf-psa-crypto/drivers/builtin/includefor public headers and . for
 # private headers. Note that . needs to be included explicitly for the sake of
 # library files that are not in the /library directory (which currently means
 # under /3rdparty).
-LOCAL_CFLAGS = $(WARNING_CFLAGS) -I. -I../include -I../tf-psa-crypto/include -D_FILE_OFFSET_BITS=64
+LOCAL_CFLAGS = $(WARNING_CFLAGS) -I. -I../include -I../tf-psa-crypto/include \
+               -I../tf-psa-crypto/drivers/builtin/include -D_FILE_OFFSET_BITS=64
 LOCAL_LDFLAGS =
 
 ifdef DEBUG