1// Copyright (C) 2018 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
15cc_defaults {
16    name: "recovery_defaults",
17
18    cflags: [
19        "-D_FILE_OFFSET_BITS=64",
20
21        // Must be the same as RECOVERY_API_VERSION.
22        "-DRECOVERY_API_VERSION=3",
23
24        "-Wall",
25        "-Werror",
26    ],
27}
28
29cc_library_static {
30    name: "librecovery_fastboot",
31    recovery_available: true,
32    defaults: [
33        "recovery_defaults",
34    ],
35
36    srcs: [
37        "fastboot/fastboot.cpp",
38    ],
39
40    shared_libs: [
41        "libbase",
42        "libbootloader_message",
43        "libcutils",
44        "liblog",
45        "librecovery_ui",
46    ],
47
48    static_libs: [
49        "librecovery_ui_default",
50    ],
51}
52
53cc_defaults {
54    name: "librecovery_defaults",
55
56    defaults: [
57        "recovery_defaults",
58    ],
59
60    shared_libs: [
61        "android.hardware.boot@1.0",
62        "android.hardware.boot@1.1",
63        "libbase",
64        "libbootloader_message",
65        "libcrypto",
66        "libcutils",
67        "libfs_mgr",
68        "liblp",
69        "liblog",
70        "libprotobuf-cpp-lite",
71        "libziparchive",
72    ],
73
74    static_libs: [
75        "libc++fs",
76        "libinstall",
77        "librecovery_fastboot",
78        "libminui",
79        "librecovery_utils",
80        "libotautil",
81        "libsnapshot_nobinder",
82    ],
83}
84
85cc_library_static {
86    name: "librecovery",
87    recovery_available: true,
88
89    defaults: [
90        "librecovery_defaults",
91    ],
92
93    srcs: [
94        "recovery.cpp",
95    ],
96
97    shared_libs: [
98        "librecovery_ui",
99    ],
100}
101
102prebuilt_etc {
103    name: "init_recovery.rc",
104    filename: "init.rc",
105    src: "etc/init.rc",
106    sub_dir: "init/hw",
107    recovery: true,
108}
109
110cc_binary {
111    name: "recovery",
112    recovery: true,
113
114    defaults: [
115        "libinstall_defaults",
116        "librecovery_defaults",
117        "librecovery_utils_defaults",
118    ],
119
120    srcs: [
121        "recovery_main.cpp",
122    ],
123
124    shared_libs: [
125        "librecovery_ui",
126    ],
127
128    static_libs: [
129        "librecovery",
130        "librecovery_ui_default",
131    ],
132
133    required: [
134        "e2fsdroid.recovery",
135        "init_recovery.rc",
136        "librecovery_ui_ext",
137        "minadbd",
138        "mke2fs.conf.recovery",
139        "mke2fs.recovery",
140        "recovery_deps",
141        "ueventd.rc.recovery",
142    ],
143}
144
145// The dynamic executable that runs after /data mounts.
146cc_binary {
147    name: "recovery-persist",
148
149    defaults: [
150        "recovery_defaults",
151    ],
152
153    srcs: [
154        "recovery-persist.cpp",
155    ],
156
157    shared_libs: [
158        "libbase",
159        "liblog",
160    ],
161
162    static_libs: [
163        "librecovery_utils",
164    ],
165
166    init_rc: [
167        "recovery-persist.rc",
168    ],
169}
170
171// The dynamic executable that runs at init.
172cc_binary {
173    name: "recovery-refresh",
174
175    defaults: [
176        "recovery_defaults",
177    ],
178
179    srcs: [
180        "recovery-refresh.cpp",
181    ],
182
183    shared_libs: [
184        "libbase",
185        "liblog",
186    ],
187
188    static_libs: [
189        "librecovery_utils",
190    ],
191
192    init_rc: [
193        "recovery-refresh.rc",
194    ],
195}
196
197filegroup {
198    name: "res-testdata",
199
200    srcs: [
201        "res-*/images/*_text.png",
202    ],
203}
204