1//
2// Copyright (C) 2016 The Android Open-Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17subdirs = [
18    "tests",
19]
20
21// A static library providing glue logic that simplifies creation of NVRAM HAL
22// modules.
23cc_library_static {
24    name: "libnvram-hal",
25    srcs: ["nvram_device_adapter.cpp"],
26    cflags: [
27        "-Wall",
28        "-Werror",
29        "-Wextra",
30    ],
31    export_include_dirs: ["include"],
32    shared_libs: ["libnvram-messages"],
33}
34
35// nvram.testing is the software-only testing NVRAM HAL module backed by the
36// fake_nvram daemon.
37cc_library_shared {
38    name: "nvram.testing",
39    relative_install_path: "hw",
40    srcs: [
41        "testing_module.c",
42        "testing_nvram_implementation.cpp",
43    ],
44    cflags: [
45        "-Wall",
46        "-Werror",
47        "-Wextra",
48        "-fvisibility=hidden",
49    ],
50    static_libs: ["libnvram-hal"],
51    shared_libs: [
52        "libnvram-messages",
53        "libcutils",
54        "libbase",
55    ],
56
57}
58
59cc_binary {
60    name: "fake-nvram",
61    srcs: [
62        "fake_nvram.cpp",
63        "fake_nvram_storage.cpp",
64    ],
65    clang: true,
66    cflags: [
67        "-Wall",
68        "-Werror",
69        "-Wextra",
70    ],
71    static_libs: ["libnvram-core"],
72    shared_libs: [
73        "libnvram-messages",
74        "libcrypto",
75        "libminijail",
76        "liblog",
77        "libcutils",
78        "libbase",
79    ],
80
81    init_rc: ["fake-nvram.rc"],
82    required: ["fake-nvram-seccomp.policy"],
83}
84
85// seccomp policy for fake_nvram.
86prebuilt_usr_share {
87    name: "fake-nvram-seccomp.policy",
88    sub_dir: "policy",
89    arch: {
90        arm: {
91            src: "fake-nvram-seccomp-arm.policy",
92        },
93        arm64: {
94            src: "fake-nvram-seccomp-arm64.policy",
95        },
96        x86: {
97            src: "fake-nvram-seccomp-x86.policy",
98        },
99        x86_64: {
100            src: "fake-nvram-seccomp-x86_64.policy",
101        },
102    },
103}
104