blob: 30b05355930bad82ce7770ed903ac166cc8c78f1 [file] [log] [blame]
Doug Zongker9931f7f2009-06-10 14:11:53 -07001# Copyright 2009 The Android Open Source Project
Tao Baoba9a42a2015-06-23 23:23:33 -07002#
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.
Doug Zongker9931f7f2009-06-10 14:11:53 -070014
15LOCAL_PATH := $(call my-dir)
16
Ethan Yonker8373cfe2017-09-08 06:50:54 -050017ifneq ($(wildcard external/e2fsprogs/misc/tune2fs.h),)
18 tune2fs_static_libraries := \
19 libext2_com_err \
20 libext2_blkid \
21 libext2_quota \
22 libext2_uuid \
23 libext2_e2p \
24 libext2fs
25 LOCAL_CFLAGS += -DHAVE_LIBTUNE2FS
26else
27 tune2fs_static_libraries :=
28endif
Doug Zongker9931f7f2009-06-10 14:11:53 -070029
Tao Bao0c7839a2016-10-10 15:48:37 -070030updater_common_static_libraries := \
31 libapplypatch \
Sen Jiang25c56972016-05-10 15:23:25 -070032 libbspatch \
Tao Bao0c7839a2016-10-10 15:48:37 -070033 libedify \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070034 libziparchive \
35 libotautil \
Tao Baobedf5fc2016-11-18 12:01:26 -080036 libbootloader_message \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070037 libutils \
Tao Bao0c7839a2016-10-10 15:48:37 -070038 libmounts \
39 libotafault \
Alex Deymo31653662017-01-11 14:02:13 -080040 libext4_utils \
Tao Bao0c7839a2016-10-10 15:48:37 -070041 libfec \
42 libfec_rs \
Tao Baobedf5fc2016-11-18 12:01:26 -080043 libfs_mgr \
Tao Bao0c7839a2016-10-10 15:48:37 -070044 liblog \
45 libselinux \
Alex Deymo67f3aa82017-01-11 14:38:20 -080046 libsparse \
Tao Bao0c7839a2016-10-10 15:48:37 -070047 libsquashfs_utils \
48 libbz \
49 libz \
50 libbase \
51 libcrypto \
52 libcrypto_utils \
53 libcutils \
Tao Baod80a9982016-03-03 11:43:47 -080054 libtune2fs \
55 $(tune2fs_static_libraries)
Sami Tolvanen0a7b4732015-06-25 10:25:36 +010056
Tao Bao0c7839a2016-10-10 15:48:37 -070057# libupdater (static library)
58# ===============================
Doug Zongker9931f7f2009-06-10 14:11:53 -070059include $(CLEAR_VARS)
60
Tao Bao0c7839a2016-10-10 15:48:37 -070061LOCAL_MODULE := libupdater
Doug Zongkerad3db092009-06-26 13:38:55 -070062
Tao Bao0c7839a2016-10-10 15:48:37 -070063LOCAL_SRC_FILES := \
64 install.cpp \
65 blockimg.cpp
Doug Zongker8edb00c2009-06-11 17:21:44 -070066
Tao Bao0c7839a2016-10-10 15:48:37 -070067LOCAL_C_INCLUDES := \
68 $(LOCAL_PATH)/.. \
69 $(LOCAL_PATH)/include \
70 external/e2fsprogs/misc
Doug Zongker9931f7f2009-06-10 14:11:53 -070071
Tao Bao0c7839a2016-10-10 15:48:37 -070072LOCAL_CFLAGS := \
73 -Wno-unused-parameter \
74 -Werror
Doug Zongker9931f7f2009-06-10 14:11:53 -070075
Tao Bao0c7839a2016-10-10 15:48:37 -070076LOCAL_EXPORT_C_INCLUDE_DIRS := \
77 $(LOCAL_PATH)/include
Stephen Smalley779701d2012-02-09 14:13:23 -050078
Tao Bao0c7839a2016-10-10 15:48:37 -070079LOCAL_STATIC_LIBRARIES := \
80 $(updater_common_static_libraries)
sndnvaps7dde36d2016-10-04 18:09:37 +080081
Tao Bao0c7839a2016-10-10 15:48:37 -070082include $(BUILD_STATIC_LIBRARY)
Ethan Yonker34ae4832016-08-24 15:32:18 -050083
Tao Bao0c7839a2016-10-10 15:48:37 -070084# updater (static executable)
85# ===============================
86include $(CLEAR_VARS)
Michael Rungeb278c252014-11-21 00:12:28 -080087
Tao Bao0c7839a2016-10-10 15:48:37 -070088LOCAL_MODULE := updater
89
90LOCAL_SRC_FILES := \
91 updater.cpp
92
93LOCAL_C_INCLUDES := \
94 $(LOCAL_PATH)/.. \
95 $(LOCAL_PATH)/include
96
97LOCAL_CFLAGS := \
98 -Wno-unused-parameter \
99 -Werror
100
101LOCAL_STATIC_LIBRARIES := \
102 libupdater \
103 $(TARGET_RECOVERY_UPDATER_LIBS) \
104 $(TARGET_RECOVERY_UPDATER_EXTRA_LIBS) \
105 $(updater_common_static_libraries)
Doug Zongker9931f7f2009-06-10 14:11:53 -0700106
Doug Zongker2b0fdc62009-06-19 11:22:06 -0700107# Each library in TARGET_RECOVERY_UPDATER_LIBS should have a function
108# named "Register_<libname>()". Here we emit a little C function that
109# gets #included by updater.c. It calls all those registration
110# functions.
111
112# Devices can also add libraries to TARGET_RECOVERY_UPDATER_EXTRA_LIBS.
113# These libs are also linked in with updater, but we don't try to call
114# any sort of registration function for these. Use this variable for
115# any subsidiary static libraries required for your registered
116# extension libs.
117
Dan Willemsenedec27a2017-03-21 16:41:14 -0700118LOCAL_MODULE_CLASS := EXECUTABLES
119inc := $(call local-generated-sources-dir)/register.inc
Doug Zongker2b0fdc62009-06-19 11:22:06 -0700120
121$(inc) : libs := $(TARGET_RECOVERY_UPDATER_LIBS)
Dan Willemsenedec27a2017-03-21 16:41:14 -0700122$(inc) :
Doug Zongker2b0fdc62009-06-19 11:22:06 -0700123 $(hide) mkdir -p $(dir $@)
124 $(hide) echo "" > $@
Michael Ward6242a8b2011-07-14 15:06:12 -0700125 $(hide) $(foreach lib,$(libs),echo "extern void Register_$(lib)(void);" >> $@;)
Doug Zongker2b0fdc62009-06-19 11:22:06 -0700126 $(hide) echo "void RegisterDeviceExtensions() {" >> $@
Michael Ward6242a8b2011-07-14 15:06:12 -0700127 $(hide) $(foreach lib,$(libs),echo " Register_$(lib)();" >> $@;)
Doug Zongker2b0fdc62009-06-19 11:22:06 -0700128 $(hide) echo "}" >> $@
129
Dan Willemsenedec27a2017-03-21 16:41:14 -0700130LOCAL_GENERATED_SOURCES := $(inc)
Doug Zongker2b0fdc62009-06-19 11:22:06 -0700131
Ying Wangeef790d2012-06-11 14:53:08 -0700132inc :=
Doug Zongker9931f7f2009-06-10 14:11:53 -0700133
134LOCAL_FORCE_STATIC_EXECUTABLE := true
135
136include $(BUILD_EXECUTABLE)