• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2020 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS.  PLEASE
16//     CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
17//     DEPENDING ON IT IN YOUR PROJECT. ***
18package {
19    default_applicable_licenses: ["external_ms-tpm-20-ref_license"],
20}
21
22// Added automatically by a large-scale-change that took the approach of
23// 'apply every license found to every target'. While this makes sure we respect
24// every license restriction, it may not be entirely correct.
25//
26// e.g. GPL in an MIT project might only apply to the contrib/ directory.
27//
28// Please consider splitting the single license below into multiple licenses,
29// taking care not to lose any license_kind information, and overriding the
30// default license using the 'licenses: [...]' property on targets as needed.
31//
32// For unused files, consider creating a 'fileGroup' with "//visibility:private"
33// to attach the license to, and including a comment whether the files may be
34// used in the current project.
35// See: http://go/android-license-faq
36license {
37    name: "external_ms-tpm-20-ref_license",
38    visibility: [":__subpackages__"],
39    license_kinds: [
40        "SPDX-license-identifier-BSD",
41        "SPDX-license-identifier-GPL-2.0",
42        "SPDX-license-identifier-MIT",
43        "legacy_by_exception_only", // by exception only
44    ],
45    license_text: [
46        "LICENSE",
47    ],
48}
49
50cc_defaults {
51    name: "ms-tpm-20-ref-defaults",
52    local_include_dirs: [
53        "TPMCmd/Platform/include",
54        "TPMCmd/Platform/include/prototypes",
55        "TPMCmd/Simulator/include",
56        "TPMCmd/Simulator/include/prototypes",
57        "TPMCmd/tpm/include",
58        "TPMCmd/tpm/include/Ossl",
59        "TPMCmd/tpm/include/prototypes",
60    ],
61    device_supported: false,
62    host_supported: true,
63    shared_libs: [
64        "libcrypto",
65    ],
66    cflags: [
67        "-DMAX_SYM_DATA=256",
68        "-DDEBUG=YES",
69        "-DUSE_DEBUG_RNG=NO",
70        "-DALG_CAMELLIA=ALG_NO",
71        "-Wno-logical-op-parentheses",
72        "-Wno-empty-body",
73        "-Wno-missing-field-initializers",
74        "-Wno-unused-parameter",
75        "-Wno-typedef-redefinition",
76    ],
77}
78
79cc_library {
80    name: "ms-tpm-20-ref-lib",
81    srcs: [
82        "TPMCmd/Platform/src/*.c",
83        "TPMCmd/Simulator/src/TPMCmdp.c",
84        "TPMCmd/Simulator/src/TcpServer.c",
85        "TPMCmd/tpm/src/command/**/*.c",
86        "TPMCmd/tpm/src/crypt/*.c",
87        "TPMCmd/tpm/src/crypt/ossl/*.c",
88        "TPMCmd/tpm/src/events/*.c",
89        "TPMCmd/tpm/src/main/*.c",
90        "TPMCmd/tpm/src/subsystem/*.c",
91        "TPMCmd/tpm/src/support/*.c",
92        "TPMCmd/tpm/src/X509/*.c",
93    ],
94    export_include_dirs: [
95        "TPMCmd/Platform/include",
96        "TPMCmd/Platform/include/prototypes",
97        "TPMCmd/Simulator/include",
98        "TPMCmd/Simulator/include/prototypes",
99        "TPMCmd/tpm/include",
100        "TPMCmd/tpm/include/Ossl",
101        "TPMCmd/tpm/include/prototypes",
102    ],
103    defaults: [ "ms-tpm-20-ref-defaults" ],
104}
105
106cc_binary_host {
107    name: "ms-tpm-20-ref",
108    srcs: [
109        "TPMCmd/Simulator/src/TPMCmds.c",
110    ],
111    shared_libs: [
112        "ms-tpm-20-ref-lib",
113    ],
114    defaults: [ "ms-tpm-20-ref-defaults" ],
115}
116