blob: 6b14289e844dac8721a11aa98ef55b86f4b33d5a [file] [log] [blame]
Todd Poynor752faf22013-06-12 13:25:59 -07001# Copyright 2013 The Android Open Source Project
2
Todd Poynor752faf22013-06-12 13:25:59 -07003LOCAL_PATH := $(call my-dir)
Todd Poynord65104c2013-08-13 15:50:42 -07004
5include $(CLEAR_VARS)
Yabin Cuie98e1772016-02-17 12:21:34 -08006LOCAL_SRC_FILES := BatteryMonitor.cpp
7LOCAL_MODULE := libbatterymonitor
8LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
9LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Michael Scott3217c5c2016-06-05 11:20:13 -070010LOCAL_STATIC_LIBRARIES := libutils libbase libbinder
Todd Poynord65104c2013-08-13 15:50:42 -070011include $(BUILD_STATIC_LIBRARY)
12
Todd Poynor752faf22013-06-12 13:25:59 -070013include $(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -070014LOCAL_SRC_FILES := \
15 healthd_mode_android.cpp \
Sandeep Patilfca82442016-11-01 08:29:30 -070016 BatteryPropertiesRegistrar.cpp
Damien Bargiacchi565ba022016-08-11 15:29:50 -070017
Sandeep Patilfca82442016-11-01 08:29:30 -070018LOCAL_MODULE := libhealthd_android
Damien Bargiacchi565ba022016-08-11 15:29:50 -070019LOCAL_EXPORT_C_INCLUDE_DIRS := \
20 $(LOCAL_PATH) \
Sandeep Patilfca82442016-11-01 08:29:30 -070021 $(LOCAL_PATH)/include
Damien Bargiacchi565ba022016-08-11 15:29:50 -070022
23LOCAL_STATIC_LIBRARIES := \
24 libbatterymonitor \
25 libbatteryservice \
Sandeep Patilfca82442016-11-01 08:29:30 -070026 libutils \
27 libbase \
28 libcutils \
29 liblog \
30 libc \
31
32include $(BUILD_STATIC_LIBRARY)
33
34include $(CLEAR_VARS)
35
Luke Song7f386dc2017-07-13 15:10:35 -070036LOCAL_MODULE := libhealthd_draw
37
38LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
39LOCAL_STATIC_LIBRARIES := \
40 libminui \
41 libbase
42LOCAL_SRC_FILES := healthd_draw.cpp
43
44ifneq ($(TARGET_HEALTHD_DRAW_SPLIT_SCREEN),)
45LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_SCREEN=$(TARGET_HEALTHD_DRAW_SPLIT_SCREEN)
46else
47LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_SCREEN=0
48endif
49
50ifneq ($(TARGET_HEALTHD_DRAW_SPLIT_OFFSET),)
51LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_OFFSET=$(TARGET_HEALTHD_DRAW_SPLIT_OFFSET)
52else
53LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_OFFSET=0
54endif
55
56include $(BUILD_STATIC_LIBRARY)
57
58include $(CLEAR_VARS)
59
Sandeep Patilfca82442016-11-01 08:29:30 -070060LOCAL_CFLAGS := -Werror
61ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
62LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
63endif
64ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
65LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
66endif
67
68LOCAL_SRC_FILES := \
69 healthd_mode_charger.cpp \
70 AnimationParser.cpp
71
72LOCAL_MODULE := libhealthd_charger
73LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include
74LOCAL_EXPORT_C_INCLUDE_DIRS := \
75 $(LOCAL_PATH) \
76 $(LOCAL_PATH)/include
77
78LOCAL_STATIC_LIBRARIES := \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070079 libminui \
80 libpng \
81 libz \
82 libutils \
83 libbase \
84 libcutils \
Luke Song7f386dc2017-07-13 15:10:35 -070085 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070086 liblog \
87 libm \
88 libc \
89
Sandeep Patilfca82442016-11-01 08:29:30 -070090ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
91LOCAL_STATIC_LIBRARIES += libsuspend
92endif
93
Damien Bargiacchi565ba022016-08-11 15:29:50 -070094include $(BUILD_STATIC_LIBRARY)
95
Sandeep Patil6012db52016-11-01 08:45:19 -070096### charger ###
Damien Bargiacchi565ba022016-08-11 15:29:50 -070097include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -080098ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
99LOCAL_CHARGER_NO_UI := true
100endif
101ifdef BRILLO
102LOCAL_CHARGER_NO_UI := true
103endif
104
Todd Poynor752faf22013-06-12 13:25:59 -0700105LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -0700106 healthd_common.cpp \
107 charger.cpp \
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800108
Sandeep Patil6012db52016-11-01 08:45:19 -0700109LOCAL_MODULE := charger
Todd Poynor752faf22013-06-12 13:25:59 -0700110LOCAL_MODULE_TAGS := optional
111LOCAL_FORCE_STATIC_EXECUTABLE := true
112LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
113LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
Sandeep Patilfca82442016-11-01 08:29:30 -0700114LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -0700115
Sandeep Patilfca82442016-11-01 08:29:30 -0700116LOCAL_CFLAGS := -Werror
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800117ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
118LOCAL_CFLAGS += -DCHARGER_NO_UI
119endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -0700120ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),)
121LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST)
122endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -0700123ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),)
124LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
125endif
126
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700127LOCAL_STATIC_LIBRARIES := \
Sandeep Patilfca82442016-11-01 08:29:30 -0700128 libhealthd_charger \
Luke Song7f386dc2017-07-13 15:10:35 -0700129 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700130 libbatterymonitor \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700131 libbase \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700132 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700133 libcutils \
134 liblog \
135 libm \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700136 libc \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700137
Sandeep Patilfca82442016-11-01 08:29:30 -0700138ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
139LOCAL_STATIC_LIBRARIES += \
140 libminui \
141 libpng \
142 libz \
143
144endif
145
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700146ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
147LOCAL_STATIC_LIBRARIES += libsuspend
148endif
149
Todd Poynord65104c2013-08-13 15:50:42 -0700150LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700151
Sandeep Patil6012db52016-11-01 08:45:19 -0700152# Symlink /charger to /sbin/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700153LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
Sandeep Patil6012db52016-11-01 08:45:19 -0700154 && ln -sf /sbin/charger $(TARGET_ROOT_OUT)/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700155
Todd Poynor752faf22013-06-12 13:25:59 -0700156include $(BUILD_EXECUTABLE)
157
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800158ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700159define _add-charger-image
160include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700161LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700162LOCAL_MODULE_STEM := $(notdir $(1))
163_img_modules += $$(LOCAL_MODULE)
164LOCAL_SRC_FILES := $1
165LOCAL_MODULE_TAGS := optional
166LOCAL_MODULE_CLASS := ETC
167LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
168include $$(BUILD_PREBUILT)
169endef
170
171_img_modules :=
172_images :=
173$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
174 $(eval $(call _add-charger-image,$(_img))))
175
176include $(CLEAR_VARS)
177LOCAL_MODULE := charger_res_images
178LOCAL_MODULE_TAGS := optional
179LOCAL_REQUIRED_MODULES := $(_img_modules)
180include $(BUILD_PHONY_PACKAGE)
181
182_add-charger-image :=
183_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800184endif # LOCAL_CHARGER_NO_UI
Sandeep Patil6012db52016-11-01 08:45:19 -0700185
186### healthd ###
187include $(CLEAR_VARS)
188
189LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -0700190 healthd_common.cpp \
191 healthd.cpp \
Sandeep Patil6012db52016-11-01 08:45:19 -0700192
193LOCAL_MODULE := healthd
194LOCAL_MODULE_TAGS := optional
195LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
196
197ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),)
198LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST)
199endif
200ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),)
201LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
202endif
203
204LOCAL_STATIC_LIBRARIES := \
205 libhealthd_android \
Sandeep Patil6012db52016-11-01 08:45:19 -0700206 libbatterymonitor \
207 libbatteryservice \
Sandeep Patila3681952016-11-08 16:27:54 -0800208 android.hardware.health@1.0-convert \
Sandeep Patil6012db52016-11-01 08:45:19 -0700209
210LOCAL_SHARED_LIBRARIES := \
211 libbinder \
212 libbase \
213 libutils \
214 libcutils \
215 liblog \
216 libm \
217 libc \
Yifan Hong62e840f2016-11-17 13:00:55 -0800218 libhidlbase \
219 libhidltransport \
Sandeep Patila3681952016-11-08 16:27:54 -0800220 android.hardware.health@1.0 \
Sandeep Patil6012db52016-11-01 08:45:19 -0700221
Sandeep Patil6012db52016-11-01 08:45:19 -0700222include $(BUILD_EXECUTABLE)