Add library as valid header file location

The persistent key implementation will be split across multiple
files as it will eventually be implementing multiple storage
backends. As these internal functions will need to be callable by
other files, we will add the headers in the library folder. This
commit adds this include location to the necessary scripts.

For tests, the library is added as an include location as testing
on-target with Mbed OS is not possible with paths including ".."
This commit is contained in:
Darryl Green 2018-11-02 10:45:36 +00:00
parent d6c91282df
commit d9eee3b417
5 changed files with 9 additions and 6 deletions

View file

@ -168,6 +168,7 @@ else()
endif()
include_directories(include/)
include_directories(library/)
if(ENABLE_ZLIB_SUPPORT)
find_package(ZLIB)

View file

@ -1,4 +1,4 @@
CFLAGS ?= -O2 -I../include
CFLAGS ?= -O2 -I../include -I../library
WARNING_CFLAGS ?= \
-Werror -Wall -Wextra \
-Wno-unused-function \

View file

@ -133,10 +133,11 @@ sub gen_entry_list {
}
sub gen_main_file {
my ($mbedtls_headers, $psa_headers, $sources, $hdr_tpl, $src_tpl, $main_tpl, $main_out) = @_;
my ($mbedtls_headers, $psa_headers, $source_headers, $sources, $hdr_tpl, $src_tpl, $main_tpl, $main_out) = @_;
my $header_entries = gen_entry_list( $hdr_tpl, @$mbedtls_headers );
$header_entries .= gen_entry_list( $hdr_tpl, @$psa_headers );
$header_entries .= gen_entry_list( $hdr_tpl, @$source_headers );
my $source_entries = gen_entry_list( $src_tpl, @$sources );
my $out = slurp_file( $main_tpl );
@ -192,6 +193,7 @@ sub main {
my @app_list = get_app_list();
my @mbedtls_headers = <$mbedtls_header_dir/*.h>;
my @psa_headers = <$psa_header_dir/*.h>;
my @source_headers = <$source_dir/*.h>;
my @sources = <$source_dir/*.c>;
map { s!/!\\!g } @mbedtls_headers;
map { s!/!\\!g } @psa_headers;
@ -199,8 +201,8 @@ sub main {
gen_app_files( @app_list );
gen_main_file( \@mbedtls_headers, \@psa_headers, \@sources,
$vsx_hdr_tpl, $vsx_src_tpl,
gen_main_file( \@mbedtls_headers, \@psa_headers, \@source_headers,
\@sources, $vsx_hdr_tpl, $vsx_src_tpl,
$vsx_main_tpl_file, $vsx_main_file );
gen_vsx_solution( @app_list );

View file

@ -6,7 +6,7 @@ CFLAGS ?= -O2
WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement -Wno-unused-function -Wno-unused-value
LDFLAGS ?=
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../include -D_FILE_OFFSET_BITS=64
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../include -I../library -D_FILE_OFFSET_BITS=64
LOCAL_LDFLAGS = -L../library \
-lmbedtls$(SHARED_SUFFIX) \
-lmbedx509$(SHARED_SUFFIX) \

View file

@ -7,7 +7,7 @@ if [ -d include/mbedtls ]; then :; else
exit 1
fi
HEADERS=$( ls include/mbedtls/*.h include/psa/*.h | egrep -v 'compat-1\.3\.h|bn_mul' )
HEADERS=$( ls include/mbedtls/*.h include/psa/*.h library/*.h | egrep -v 'compat-1\.3\.h|bn_mul' )
rm -f identifiers