xref: /aosp_15_r20/system/sepolicy/tools/Android.bp (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1*e4a36f41SAndroid Build Coastguard Worker/*
2*e4a36f41SAndroid Build Coastguard Worker * Copyright (C) 2018 The Android Open Source Project
3*e4a36f41SAndroid Build Coastguard Worker *
4*e4a36f41SAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*e4a36f41SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*e4a36f41SAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*e4a36f41SAndroid Build Coastguard Worker *
8*e4a36f41SAndroid Build Coastguard Worker *      http://www.apache.org/licenses/LICENSE-2.0
9*e4a36f41SAndroid Build Coastguard Worker *
10*e4a36f41SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*e4a36f41SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*e4a36f41SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*e4a36f41SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*e4a36f41SAndroid Build Coastguard Worker * limitations under the License.
15*e4a36f41SAndroid Build Coastguard Worker */
16*e4a36f41SAndroid Build Coastguard Worker
17*e4a36f41SAndroid Build Coastguard Workerpackage {
18*e4a36f41SAndroid Build Coastguard Worker    // http://go/android-license-faq
19*e4a36f41SAndroid Build Coastguard Worker    // A large-scale-change added 'default_applicable_licenses' to import
20*e4a36f41SAndroid Build Coastguard Worker    // the below license kinds from "system_sepolicy_license":
21*e4a36f41SAndroid Build Coastguard Worker    //   SPDX-license-identifier-Apache-2.0
22*e4a36f41SAndroid Build Coastguard Worker    default_applicable_licenses: ["system_sepolicy_license"],
23*e4a36f41SAndroid Build Coastguard Worker}
24*e4a36f41SAndroid Build Coastguard Worker
25*e4a36f41SAndroid Build Coastguard Workercc_defaults {
26*e4a36f41SAndroid Build Coastguard Worker    name: "sepolicy_tools_defaults",
27*e4a36f41SAndroid Build Coastguard Worker    cflags: [
28*e4a36f41SAndroid Build Coastguard Worker        "-Wall",
29*e4a36f41SAndroid Build Coastguard Worker        "-Werror",
30*e4a36f41SAndroid Build Coastguard Worker    ],
31*e4a36f41SAndroid Build Coastguard Worker    static_libs: ["libsepol"],
32*e4a36f41SAndroid Build Coastguard Worker    stl: "none",
33*e4a36f41SAndroid Build Coastguard Worker}
34*e4a36f41SAndroid Build Coastguard Worker
35*e4a36f41SAndroid Build Coastguard Workercc_binary_host {
36*e4a36f41SAndroid Build Coastguard Worker    name: "checkseapp",
37*e4a36f41SAndroid Build Coastguard Worker    defaults: ["sepolicy_tools_defaults"],
38*e4a36f41SAndroid Build Coastguard Worker    srcs: ["check_seapp.c"],
39*e4a36f41SAndroid Build Coastguard Worker    whole_static_libs: ["libpcre2"],
40*e4a36f41SAndroid Build Coastguard Worker    cflags: ["-DLINK_SEPOL_STATIC"],
41*e4a36f41SAndroid Build Coastguard Worker}
42*e4a36f41SAndroid Build Coastguard Worker
43*e4a36f41SAndroid Build Coastguard Workercc_binary_host {
44*e4a36f41SAndroid Build Coastguard Worker    name: "checkfc",
45*e4a36f41SAndroid Build Coastguard Worker    defaults: ["sepolicy_tools_defaults"],
46*e4a36f41SAndroid Build Coastguard Worker    srcs: ["checkfc.c"],
47*e4a36f41SAndroid Build Coastguard Worker    static_libs: ["libselinux"],
48*e4a36f41SAndroid Build Coastguard Worker}
49*e4a36f41SAndroid Build Coastguard Worker
50*e4a36f41SAndroid Build Coastguard Workercc_binary_host {
51*e4a36f41SAndroid Build Coastguard Worker    name: "sepolicy-check",
52*e4a36f41SAndroid Build Coastguard Worker    defaults: ["sepolicy_tools_defaults"],
53*e4a36f41SAndroid Build Coastguard Worker    srcs: ["sepolicy-check.c"],
54*e4a36f41SAndroid Build Coastguard Worker}
55*e4a36f41SAndroid Build Coastguard Worker
56*e4a36f41SAndroid Build Coastguard Workercc_binary_host {
57*e4a36f41SAndroid Build Coastguard Worker    name: "version_policy",
58*e4a36f41SAndroid Build Coastguard Worker    defaults: ["sepolicy_tools_defaults"],
59*e4a36f41SAndroid Build Coastguard Worker    srcs: ["version_policy.c"],
60*e4a36f41SAndroid Build Coastguard Worker}
61*e4a36f41SAndroid Build Coastguard Worker
62*e4a36f41SAndroid Build Coastguard Workercc_binary {
63*e4a36f41SAndroid Build Coastguard Worker    name: "seamendc",
64*e4a36f41SAndroid Build Coastguard Worker    defaults: ["sepolicy_tools_defaults"],
65*e4a36f41SAndroid Build Coastguard Worker    srcs: ["seamendc.c"],
66*e4a36f41SAndroid Build Coastguard Worker    host_supported: true,
67*e4a36f41SAndroid Build Coastguard Worker}
68*e4a36f41SAndroid Build Coastguard Worker
69*e4a36f41SAndroid Build Coastguard Workerpython_binary_host {
70*e4a36f41SAndroid Build Coastguard Worker    name: "insertkeys",
71*e4a36f41SAndroid Build Coastguard Worker    srcs: ["insertkeys.py"],
72*e4a36f41SAndroid Build Coastguard Worker}
73*e4a36f41SAndroid Build Coastguard Worker
74*e4a36f41SAndroid Build Coastguard Workerpython_binary_host {
75*e4a36f41SAndroid Build Coastguard Worker    name: "sepolicy_generate_compat",
76*e4a36f41SAndroid Build Coastguard Worker    srcs: ["sepolicy_generate_compat.py"],
77*e4a36f41SAndroid Build Coastguard Worker    libs: [
78*e4a36f41SAndroid Build Coastguard Worker        "mini_cil_parser",
79*e4a36f41SAndroid Build Coastguard Worker        "pysepolwrap",
80*e4a36f41SAndroid Build Coastguard Worker    ],
81*e4a36f41SAndroid Build Coastguard Worker    data: [":libsepolwrap"],
82*e4a36f41SAndroid Build Coastguard Worker}
83*e4a36f41SAndroid Build Coastguard Worker
84*e4a36f41SAndroid Build Coastguard Workerpython_binary_host {
85*e4a36f41SAndroid Build Coastguard Worker    name: "fuzzer_bindings_check",
86*e4a36f41SAndroid Build Coastguard Worker    srcs: ["fuzzer_bindings_check.py"],
87*e4a36f41SAndroid Build Coastguard Worker}
88