xref: /rk3399_ARM-atf/drivers/auth/mbedtls/mbedtls_common.mk (revision 649dbf6f3666fa4ec8bad318d01b946fb89063e0)
17d37aa17SJuan Castillo#
27d37aa17SJuan Castillo# Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
37d37aa17SJuan Castillo#
47d37aa17SJuan Castillo# Redistribution and use in source and binary forms, with or without
57d37aa17SJuan Castillo# modification, are permitted provided that the following conditions are met:
67d37aa17SJuan Castillo#
77d37aa17SJuan Castillo# Redistributions of source code must retain the above copyright notice, this
87d37aa17SJuan Castillo# list of conditions and the following disclaimer.
97d37aa17SJuan Castillo#
107d37aa17SJuan Castillo# Redistributions in binary form must reproduce the above copyright notice,
117d37aa17SJuan Castillo# this list of conditions and the following disclaimer in the documentation
127d37aa17SJuan Castillo# and/or other materials provided with the distribution.
137d37aa17SJuan Castillo#
147d37aa17SJuan Castillo# Neither the name of ARM nor the names of its contributors may be used
157d37aa17SJuan Castillo# to endorse or promote products derived from this software without specific
167d37aa17SJuan Castillo# prior written permission.
177d37aa17SJuan Castillo#
187d37aa17SJuan Castillo# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
197d37aa17SJuan Castillo# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
207d37aa17SJuan Castillo# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
217d37aa17SJuan Castillo# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
227d37aa17SJuan Castillo# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
237d37aa17SJuan Castillo# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
247d37aa17SJuan Castillo# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
257d37aa17SJuan Castillo# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
267d37aa17SJuan Castillo# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
277d37aa17SJuan Castillo# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
287d37aa17SJuan Castillo# POSSIBILITY OF SUCH DAMAGE.
297d37aa17SJuan Castillo#
307d37aa17SJuan Castillo
317d37aa17SJuan Castilloifneq (${MBEDTLS_COMMON_MK},1)
327d37aa17SJuan CastilloMBEDTLS_COMMON_MK	:=	1
337d37aa17SJuan Castillo
347d37aa17SJuan Castillo# MBEDTLS_DIR must be set to the mbed TLS main directory (it must contain
357d37aa17SJuan Castillo# the 'include' and 'library' subdirectories).
367d37aa17SJuan Castilloifeq (${MBEDTLS_DIR},)
377d37aa17SJuan Castillo  $(error Error: MBEDTLS_DIR not set)
387d37aa17SJuan Castilloendif
397d37aa17SJuan Castillo
407d37aa17SJuan CastilloINCLUDES		+=	-I${MBEDTLS_DIR}/include		\
417d37aa17SJuan Castillo				-Iinclude/drivers/auth/mbedtls
427d37aa17SJuan Castillo
437d37aa17SJuan Castillo# Specify mbed TLS configuration file
44*649dbf6fSJuan CastilloMBEDTLS_CONFIG_FILE	:=	"<mbedtls_config.h>"
45*649dbf6fSJuan Castillo$(eval $(call add_define,MBEDTLS_CONFIG_FILE))
467d37aa17SJuan Castillo
477d37aa17SJuan CastilloMBEDTLS_COMMON_SOURCES	:=	drivers/auth/mbedtls/mbedtls_common.c	\
487d37aa17SJuan Castillo				$(addprefix ${MBEDTLS_DIR}/library/,	\
497d37aa17SJuan Castillo				asn1parse.c 				\
507d37aa17SJuan Castillo				asn1write.c 				\
517d37aa17SJuan Castillo				memory_buffer_alloc.c			\
527d37aa17SJuan Castillo				oid.c 					\
537d37aa17SJuan Castillo				platform.c 				\
547d37aa17SJuan Castillo				)
557d37aa17SJuan Castillo
567d37aa17SJuan CastilloBL1_SOURCES		+=	${MBEDTLS_COMMON_SOURCES}
577d37aa17SJuan CastilloBL2_SOURCES		+=	${MBEDTLS_COMMON_SOURCES}
587d37aa17SJuan CastilloDISABLE_PEDANTIC	:=	1
597d37aa17SJuan Castillo
607d37aa17SJuan Castilloendif
61