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            ],
61        },
62    },
63}
64
65cc_binary {
66    name: "lpdump",
67    defaults: ["lp_defaults"],
68    host_supported: true,
69    shared_libs: [
70        "libbase",
71        "liblog",
72        "liblp",
73    ],
74    static_libs: [
75        "libjsonpbparse",
76    ],
77    target: {
78        android: {
79            srcs: [
80                "lpdump_target.cc",
81            ],
82            shared_libs: [
83                "liblpdump_interface-cpp",
84                "libbinder",
85                "libutils",
86            ],
87            required: [
88                "lpdumpd",
89            ],
90        },
91        host: {
92            srcs: [
93                "lpdump_host.cc",
94            ],
95            shared_libs: [
96                "liblpdump",
97            ],
98        },
99    },
100}
101
102cc_binary_host {
103    name: "lpmake",
104    defaults: ["lp_defaults"],
105    shared_libs: [
106        "libbase",
107        "liblog",
108        "liblp",
109    ],
110    srcs: [
111        "lpmake.cc",
112    ],
113    target: {
114        windows: {
115            enabled: true,
116        },
117    },
118}
119
120cc_binary_host {
121    name: "lpadd",
122    defaults: ["lp_defaults"],
123    shared_libs: [
124        "libbase",
125        "liblog",
126        "liblp",
127        "libsparse",
128    ],
129    srcs: [
130        "lpadd.cc",
131    ],
132}
133
134cc_binary {
135    name: "lpflash",
136    defaults: ["lp_defaults"],
137    host_supported: true,
138    shared_libs: [
139        "libbase",
140        "liblog",
141        "liblp",
142    ],
143    srcs: [
144        "lpflash.cc",
145    ],
146}
147
148cc_binary {
149    name: "lpdumpd",
150    defaults: [
151        "lp_defaults",
152        "libsnapshot_cow_defaults",
153        "libsnapshot_hal_deps",
154    ],
155    init_rc: ["lpdumpd.rc"],
156    shared_libs: [
157        "libbase",
158        "libbinder",
159        "libfs_mgr_binder",
160        "liblog",
161        "liblp",
162        "liblpdump",
163        "liblpdump_interface-cpp",
164        "libprotobuf-cpp-lite",
165        "libsnapshot",
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