xref: /aosp_15_r20/system/extras/partition_tools/Android.bp (revision 288bf5226967eb3dac5cce6c939ccc2a7f2b4fe5)
1//
2// Copyright (C) 2018 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
17package {
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21cc_defaults {
22    name: "lp_defaults",
23    cflags: [
24        "-Werror",
25        "-Wextra",
26        "-D_FILE_OFFSET_BITS=64",
27    ],
28    target: {
29        linux_bionic: {
30            enabled: true,
31        },
32    },
33}
34
35cc_library_shared {
36    name: "liblpdump",
37    defaults: ["lp_defaults"],
38    host_supported: true,
39    shared_libs: [
40        "libbase",
41        "liblog",
42        "liblp",
43        "libprotobuf-cpp-full",
44    ],
45    static_libs: [
46        "libjsonpbparse",
47    ],
48    srcs: [
49        "lpdump.cc",
50        "dynamic_partitions_device_info.proto",
51    ],
52    proto: {
53        type: "full",
54    },
55    target: {
56        android: {
57            shared_libs: [
58                "libcutils",
59                "libfs_mgr",
60                "libsnapshot",
61            ],
62        },
63    },
64}
65
66cc_binary {
67    name: "lpdump",
68    defaults: ["lp_defaults"],
69    host_supported: true,
70    shared_libs: [
71        "libbase",
72        "liblog",
73        "liblp",
74    ],
75    static_libs: [
76        "libjsonpbparse",
77    ],
78    target: {
79        android: {
80            srcs: [
81                "lpdump_target.cc",
82            ],
83            shared_libs: [
84                "liblpdump_interface-cpp",
85                "libbinder",
86                "libutils",
87            ],
88            required: [
89                "lpdumpd",
90            ],
91        },
92        host: {
93            srcs: [
94                "lpdump_host.cc",
95            ],
96            shared_libs: [
97                "liblpdump",
98            ],
99        },
100    },
101}
102
103cc_binary_host {
104    name: "lpmake",
105    defaults: ["lp_defaults"],
106    shared_libs: [
107        "libbase",
108        "liblog",
109        "liblp",
110    ],
111    srcs: [
112        "lpmake.cc",
113    ],
114    target: {
115        windows: {
116            enabled: true,
117        },
118    },
119}
120
121cc_binary_host {
122    name: "lpadd",
123    defaults: ["lp_defaults"],
124    shared_libs: [
125        "libbase",
126        "liblog",
127        "liblp",
128        "libsparse",
129    ],
130    srcs: [
131        "lpadd.cc",
132    ],
133}
134
135cc_binary {
136    name: "lpflash",
137    defaults: ["lp_defaults"],
138    host_supported: true,
139    shared_libs: [
140        "libbase",
141        "liblog",
142        "liblp",
143    ],
144    srcs: [
145        "lpflash.cc",
146    ],
147}
148
149cc_binary {
150    name: "lpdumpd",
151    defaults: [
152        "lp_defaults",
153        "libsnapshot_cow_defaults",
154        "libsnapshot_hal_deps",
155    ],
156    init_rc: ["lpdumpd.rc"],
157    shared_libs: [
158        "libbase",
159        "libbinder",
160        "libfs_mgr_binder",
161        "liblog",
162        "liblp",
163        "liblpdump",
164        "liblpdump_interface-cpp",
165        "libprotobuf-cpp-lite",
166        "libutils",
167    ],
168    static_libs: [
169        "update_metadata-protos",
170    ],
171    srcs: [
172        "lpdumpd.cc",
173    ],
174}
175
176cc_binary_host {
177    name: "lpunpack",
178    defaults: ["lp_defaults"],
179    shared_libs: [
180        "libbase",
181        "liblog",
182        "liblp",
183        "libsparse",
184    ],
185    srcs: [
186        "lpunpack.cc",
187    ],
188    cppflags: [
189        "-D_FILE_OFFSET_BITS=64",
190    ],
191}
192