1LOCAL_PATH := $(call my-dir)
2
3common_src_files := commands.cpp globals.cpp utils.cpp
4common_cflags := -Wall -Werror
5
6#
7# Static library used in testing and executable
8#
9
10include $(CLEAR_VARS)
11LOCAL_MODULE := libinstalld
12LOCAL_MODULE_TAGS := eng tests
13LOCAL_SRC_FILES := $(common_src_files)
14LOCAL_CFLAGS := $(common_cflags)
15LOCAL_SHARED_LIBRARIES := \
16    libbase \
17    liblogwrap \
18    libselinux \
19
20LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
21LOCAL_CLANG := true
22include $(BUILD_STATIC_LIBRARY)
23
24#
25# Executable
26#
27
28include $(CLEAR_VARS)
29LOCAL_MODULE := installd
30LOCAL_MODULE_TAGS := optional
31LOCAL_CFLAGS := $(common_cflags)
32LOCAL_SRC_FILES := installd.cpp $(common_src_files)
33LOCAL_SHARED_LIBRARIES := \
34    libbase \
35    libcutils \
36    liblog \
37    liblogwrap \
38    libselinux \
39
40LOCAL_STATIC_LIBRARIES := libdiskusage
41LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
42LOCAL_INIT_RC := installd.rc
43LOCAL_CLANG := true
44include $(BUILD_EXECUTABLE)
45
46#
47# OTA Executable
48#
49
50include $(CLEAR_VARS)
51LOCAL_MODULE := otapreopt
52LOCAL_MODULE_TAGS := optional
53LOCAL_CFLAGS := $(common_cflags)
54
55# Base & ASLR boundaries for boot image creation.
56ifndef LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA
57  LOCAL_LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA := -0x1000000
58else
59  LOCAL_LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA := $(LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA)
60endif
61ifndef LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA
62  LOCAL_LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA := 0x1000000
63else
64  LOCAL_LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA := $(LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA)
65endif
66LOCAL_CFLAGS += -DART_BASE_ADDRESS=$(LIBART_IMG_HOST_BASE_ADDRESS)
67LOCAL_CFLAGS += -DART_BASE_ADDRESS_MIN_DELTA=$(LOCAL_LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA)
68LOCAL_CFLAGS += -DART_BASE_ADDRESS_MAX_DELTA=$(LOCAL_LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA)
69
70LOCAL_SRC_FILES := otapreopt.cpp $(common_src_files)
71LOCAL_SHARED_LIBRARIES := \
72    libbase \
73    libcutils \
74    liblog \
75    liblogwrap \
76    libselinux \
77
78LOCAL_STATIC_LIBRARIES := libdiskusage
79LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
80LOCAL_CLANG := true
81include $(BUILD_EXECUTABLE)
82
83# OTA chroot tool
84
85include $(CLEAR_VARS)
86LOCAL_MODULE := otapreopt_chroot
87LOCAL_MODULE_TAGS := optional
88LOCAL_CFLAGS := $(common_cflags)
89
90LOCAL_SRC_FILES := otapreopt_chroot.cpp
91LOCAL_SHARED_LIBRARIES := \
92    libbase \
93    liblog \
94
95LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
96LOCAL_CLANG := true
97include $(BUILD_EXECUTABLE)
98
99# OTA postinstall script
100
101include $(CLEAR_VARS)
102LOCAL_MODULE:= otapreopt_script
103LOCAL_MODULE_TAGS := optional
104LOCAL_MODULE_CLASS := EXECUTABLES
105LOCAL_SRC_FILES := otapreopt_script.sh
106
107# Let this depend on otapreopt and the chroot tool, so we just have to mention one in a
108# configuration.
109LOCAL_REQUIRED_MODULES := otapreopt otapreopt_chroot
110
111include $(BUILD_PREBUILT)
112
113# Tests.
114
115include $(LOCAL_PATH)/tests/Android.mk