1# Copyright (C) 2007 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
15LOCAL_PATH := $(call my-dir)
16
17include $(CLEAR_VARS)
18
19LOCAL_SRC_FILES := fuse_sideload.cpp
20LOCAL_CLANG := true
21LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter
22LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE
23
24LOCAL_MODULE := libfusesideload
25
26LOCAL_STATIC_LIBRARIES := libcutils libc libcrypto_static
27include $(BUILD_STATIC_LIBRARY)
28
29include $(CLEAR_VARS)
30
31LOCAL_SRC_FILES := \
32    adb_install.cpp \
33    asn1_decoder.cpp \
34    bootloader.cpp \
35    device.cpp \
36    fuse_sdcard_provider.cpp \
37    install.cpp \
38    recovery.cpp \
39    roots.cpp \
40    screen_ui.cpp \
41    ui.cpp \
42    verifier.cpp \
43    wear_ui.cpp \
44    wear_touch.cpp \
45
46LOCAL_MODULE := recovery
47
48LOCAL_FORCE_STATIC_EXECUTABLE := true
49
50ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
51ifeq ($(HOST_OS),linux)
52LOCAL_REQUIRED_MODULES := mkfs.f2fs
53endif
54endif
55
56RECOVERY_API_VERSION := 3
57RECOVERY_FSTAB_VERSION := 2
58LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
59LOCAL_CFLAGS += -Wno-unused-parameter
60LOCAL_CLANG := true
61
62LOCAL_C_INCLUDES += \
63    system/vold \
64    system/extras/ext4_utils \
65    system/core/adb \
66
67LOCAL_STATIC_LIBRARIES := \
68    libbatterymonitor \
69    libext4_utils_static \
70    libsparse_static \
71    libminzip \
72    libz \
73    libmtdutils \
74    libminadbd \
75    libfusesideload \
76    libminui \
77    libpng \
78    libfs_mgr \
79    libcrypto_static \
80    libbase \
81    libcutils \
82    libutils \
83    liblog \
84    libselinux \
85    libm \
86    libc
87
88LOCAL_HAL_STATIC_LIBRARIES := libhealthd
89
90ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
91    LOCAL_CFLAGS += -DUSE_EXT4
92    LOCAL_C_INCLUDES += system/extras/ext4_utils
93    LOCAL_STATIC_LIBRARIES += libext4_utils_static libz
94endif
95
96LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
97
98ifeq ($(TARGET_RECOVERY_UI_LIB),)
99  LOCAL_SRC_FILES += default_device.cpp
100else
101  LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB)
102endif
103
104ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
105LOCAL_REQUIRED_MODULES := recovery-persist recovery-refresh
106endif
107
108include $(BUILD_EXECUTABLE)
109
110# recovery-persist (system partition dynamic executable run after /data mounts)
111# ===============================
112include $(CLEAR_VARS)
113LOCAL_SRC_FILES := recovery-persist.cpp
114LOCAL_MODULE := recovery-persist
115LOCAL_SHARED_LIBRARIES := liblog libbase
116LOCAL_CFLAGS := -Werror
117LOCAL_INIT_RC := recovery-persist.rc
118include $(BUILD_EXECUTABLE)
119
120# recovery-refresh (system partition dynamic executable run at init)
121# ===============================
122include $(CLEAR_VARS)
123LOCAL_SRC_FILES := recovery-refresh.cpp
124LOCAL_MODULE := recovery-refresh
125LOCAL_SHARED_LIBRARIES := liblog
126LOCAL_CFLAGS := -Werror
127LOCAL_INIT_RC := recovery-refresh.rc
128include $(BUILD_EXECUTABLE)
129
130# All the APIs for testing
131include $(CLEAR_VARS)
132LOCAL_CLANG := true
133LOCAL_MODULE := libverifier
134LOCAL_MODULE_TAGS := tests
135LOCAL_SRC_FILES := \
136    asn1_decoder.cpp \
137    verifier.cpp \
138    ui.cpp
139LOCAL_STATIC_LIBRARIES := libcrypto_static
140include $(BUILD_STATIC_LIBRARY)
141
142include $(LOCAL_PATH)/minui/Android.mk \
143    $(LOCAL_PATH)/minzip/Android.mk \
144    $(LOCAL_PATH)/minadbd/Android.mk \
145    $(LOCAL_PATH)/mtdutils/Android.mk \
146    $(LOCAL_PATH)/tests/Android.mk \
147    $(LOCAL_PATH)/tools/Android.mk \
148    $(LOCAL_PATH)/edify/Android.mk \
149    $(LOCAL_PATH)/uncrypt/Android.mk \
150    $(LOCAL_PATH)/otafault/Android.mk \
151    $(LOCAL_PATH)/updater/Android.mk \
152    $(LOCAL_PATH)/update_verifier/Android.mk \
153    $(LOCAL_PATH)/applypatch/Android.mk
154