aboutsummaryrefslogtreecommitdiff
path: root/cmake/install.cmake
blob: 8d9fe3f37840a051b11b26f143854b0477a675c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#-------------------------------------------------------------------------------
# Copyright (c) 2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------

# Generate correct filename
string(TOUPPER ${TFM_PLATFORM} TFM_PLATFORM_UPPERCASE)
string(REGEX REPLACE "-" "_" TFM_PLATFORM_UPPERCASE_UNDERSCORE ${TFM_PLATFORM_UPPERCASE})
string(REGEX REPLACE "^(\\.\\.([\\/\\\\]))+" "EXTERNAL\\2" TFM_PLATFORM_UPPERCASE_UNDERSCORE_NO_PARENT_DIR ${TFM_PLATFORM_UPPERCASE_UNDERSCORE})

install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/
        DESTINATION ${CMAKE_BINARY_DIR}/install/outputs/${TFM_PLATFORM_UPPERCASE_UNDERSCORE_NO_PARENT_DIR}
)

set(INTERFACE_INC_DIR ${CMAKE_SOURCE_DIR}/interface/include)
set(INTERFACE_SRC_DIR ${CMAKE_SOURCE_DIR}/interface/src)
set(EXPORT_INC_DIR    ${CMAKE_BINARY_DIR}/install/export/tfm/include)
set(EXPORT_SRC_DIR    ${CMAKE_BINARY_DIR}/install/export/tfm/src)

# export veneer lib
if (NOT TFM_MULTI_CORE_TOPOLOGY)
    install(FILES       ${CMAKE_BINARY_DIR}/secure_fw/s_veneers.o
            DESTINATION ${CMAKE_BINARY_DIR}/install/export/tfm/lib)
endif()

####################### export headers #########################################

install(FILES       ${INTERFACE_INC_DIR}/psa/client.h
                    ${INTERFACE_INC_DIR}/psa/error.h
        DESTINATION ${EXPORT_INC_DIR}/psa)

install(FILES       ${INTERFACE_INC_DIR}/os_wrapper/common.h
                    ${INTERFACE_INC_DIR}/os_wrapper/mutex.h
        DESTINATION ${EXPORT_INC_DIR}/os_wrapper)

install(FILES       ${CMAKE_BINARY_DIR}/generated/interface/include/psa_manifest/sid.h
        DESTINATION ${EXPORT_INC_DIR}/psa_manifest)

install(FILES       ${INTERFACE_INC_DIR}/tfm_api.h
                    ${INTERFACE_INC_DIR}/tfm_ns_interface.h
                    ${INTERFACE_INC_DIR}/tfm_ns_svc.h
        DESTINATION ${EXPORT_INC_DIR})

install(FILES       ${INTERFACE_INC_DIR}/ext/tz_context.h
        DESTINATION ${EXPORT_INC_DIR}/ext)

if (TFM_MULTI_CORE_TOPOLOGY)
    install(FILES       ${INTERFACE_INC_DIR}/tfm_multi_core_api.h
                        ${INTERFACE_INC_DIR}/tfm_ns_mailbox.h
                        ${INTERFACE_INC_DIR}/tfm_mailbox.h
            DESTINATION ${EXPORT_INC_DIR})
else()
    install(FILES       ${CMAKE_BINARY_DIR}/generated/interface/include/tfm_veneers.h
            DESTINATION ${EXPORT_INC_DIR}/tfm/veneers)
endif()

if (TFM_NS_CLIENT_IDENTIFICATION)
    install(FILES       ${INTERFACE_INC_DIR}/tfm_nspm_api.h
                        ${INTERFACE_INC_DIR}/tfm_nspm_svc_handler.h
            DESTINATION ${EXPORT_INC_DIR})
endif()

if (TFM_PARTITION_PROTECTED_STORAGE)
    install(FILES       ${INTERFACE_INC_DIR}/psa/protected_storage.h
            DESTINATION ${EXPORT_INC_DIR}/psa)
endif()

if (TFM_PARTITION_INTERNAL_TRUSTED_STORAGE)
    install(FILES       ${INTERFACE_INC_DIR}/psa/internal_trusted_storage.h
                        ${INTERFACE_INC_DIR}/psa/storage_common.h
            DESTINATION ${EXPORT_INC_DIR}/psa)
endif()

if (TFM_PARTITION_CRYPTO)
    install(FILES       ${INTERFACE_INC_DIR}/psa/crypto_extra.h
                        ${INTERFACE_INC_DIR}/psa/crypto_compat.h
                        ${INTERFACE_INC_DIR}/psa/crypto.h
                        ${INTERFACE_INC_DIR}/psa/crypto_client_struct.h
                        ${INTERFACE_INC_DIR}/psa/crypto_sizes.h
                        ${INTERFACE_INC_DIR}/psa/crypto_struct.h
                        ${INTERFACE_INC_DIR}/psa/crypto_types.h
                        ${INTERFACE_INC_DIR}/psa/crypto_values.h
            DESTINATION ${EXPORT_INC_DIR}/psa)
    install(FILES       ${INTERFACE_INC_DIR}/tfm_crypto_defs.h
            DESTINATION ${EXPORT_INC_DIR})
endif()

if (TFM_PARTITION_INITIAL_ATTESTATION)
    install(FILES       ${INTERFACE_INC_DIR}/psa/initial_attestation.h
            DESTINATION ${EXPORT_INC_DIR}/psa)
endif()

if(TFM_PARTITION_AUDIT_LOG)
    install(FILES       ${INTERFACE_INC_DIR}/psa_audit_api.h
                        ${INTERFACE_INC_DIR}/psa_audit_defs.h
            DESTINATION ${EXPORT_INC_DIR})
endif()

if(TFM_PARTITION_PLATFORM)
    install(FILES       ${INTERFACE_INC_DIR}/tfm_platform_api.h
            DESTINATION ${EXPORT_INC_DIR})
endif()

####################### export sources #########################################

if (TFM_MULTI_CORE_TOPOLOGY)
    install(FILES       ${INTERFACE_SRC_DIR}/tfm_ns_mailbox.c
                        ${INTERFACE_SRC_DIR}/tfm_multi_core_api.c
                        ${INTERFACE_SRC_DIR}/tfm_multi_core_psa_ns_api.c
            DESTINATION ${EXPORT_SRC_DIR})
else()
    install(FILES       ${INTERFACE_SRC_DIR}/tfm_ns_interface.c
            DESTINATION ${EXPORT_SRC_DIR})

    if(TFM_PSA_API)
        install(FILES       ${INTERFACE_SRC_DIR}/tfm_psa_ns_api.c
                DESTINATION ${EXPORT_SRC_DIR})
    endif()
endif()

if (TFM_NS_CLIENT_IDENTIFICATION)
    install(FILES       ${INTERFACE_SRC_DIR}/tfm_nspm_api.c
                        ${INTERFACE_SRC_DIR}/tfm_nspm_svc_handler.c
            DESTINATION ${EXPORT_SRC_DIR})
endif()

if (TFM_PARTITION_PROTECTED_STORAGE)
    if (TFM_PSA_API)
        install(FILES       ${INTERFACE_SRC_DIR}/tfm_ps_ipc_api.c
                DESTINATION ${EXPORT_SRC_DIR})
    else()
        install(FILES       ${INTERFACE_SRC_DIR}/tfm_ps_func_api.c
                DESTINATION ${EXPORT_SRC_DIR})
    endif()
endif()

if (TFM_PARTITION_INTERNAL_TRUSTED_STORAGE)
    if (TFM_PSA_API)
        install(FILES       ${INTERFACE_SRC_DIR}/tfm_its_ipc_api.c
                DESTINATION ${EXPORT_SRC_DIR})
    else()
        install(FILES       ${INTERFACE_SRC_DIR}/tfm_its_func_api.c
                DESTINATION ${EXPORT_SRC_DIR})
    endif()
endif()

if (TFM_PARTITION_CRYPTO)
    if (TFM_PSA_API)
        install(FILES       ${INTERFACE_SRC_DIR}/tfm_crypto_ipc_api.c
                DESTINATION ${EXPORT_SRC_DIR})
    else()
        install(FILES       ${INTERFACE_SRC_DIR}/tfm_crypto_func_api.c
                DESTINATION ${EXPORT_SRC_DIR})
    endif()
endif()

if (TFM_PARTITION_INITIAL_ATTESTATION)
    if (TFM_PSA_API)
        install(FILES       ${INTERFACE_SRC_DIR}/tfm_initial_attestation_ipc_api.c
                DESTINATION ${EXPORT_SRC_DIR})
    else()
        install(FILES       ${INTERFACE_SRC_DIR}/tfm_initial_attestation_func_api.c
                DESTINATION ${EXPORT_SRC_DIR})
    endif()
endif()

if(TFM_PARTITION_AUDIT_LOG)
    install(FILES       ${INTERFACE_SRC_DIR}/tfm_audit_func_api.c
            DESTINATION ${EXPORT_SRC_DIR})
endif()

if(TFM_PARTITION_PLATFORM)
    if(TFM_PSA_API)
        install(FILES       ${INTERFACE_SRC_DIR}/tfm_platform_ipc_api.c
                DESTINATION ${EXPORT_SRC_DIR})
    else()
        install(FILES       ${INTERFACE_SRC_DIR}/tfm_platform_func_api.c
                DESTINATION ${EXPORT_SRC_DIR})
    endif()
endif()