blob: 1244903543bb1aaa14d42b935a4786235030be8a [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)
Damien Bargiacchi565ba022016-08-11 15:29:50 -07006LOCAL_SRC_FILES := \
7 healthd_mode_android.cpp \
Sandeep Patilfca82442016-11-01 08:29:30 -07008 BatteryPropertiesRegistrar.cpp
Damien Bargiacchi565ba022016-08-11 15:29:50 -07009
Sandeep Patilfca82442016-11-01 08:29:30 -070010LOCAL_MODULE := libhealthd_android
Damien Bargiacchi565ba022016-08-11 15:29:50 -070011LOCAL_EXPORT_C_INCLUDE_DIRS := \
12 $(LOCAL_PATH) \
Sandeep Patilfca82442016-11-01 08:29:30 -070013 $(LOCAL_PATH)/include
Damien Bargiacchi565ba022016-08-11 15:29:50 -070014
15LOCAL_STATIC_LIBRARIES := \
16 libbatterymonitor \
17 libbatteryservice \
Sandeep Patilfca82442016-11-01 08:29:30 -070018 libutils \
19 libbase \
20 libcutils \
21 liblog \
22 libc \
23
24include $(BUILD_STATIC_LIBRARY)
25
26include $(CLEAR_VARS)
27
Luke Song7f386dc2017-07-13 15:10:35 -070028LOCAL_MODULE := libhealthd_draw
29
30LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
31LOCAL_STATIC_LIBRARIES := \
32 libminui \
33 libbase
34LOCAL_SRC_FILES := healthd_draw.cpp
35
36ifneq ($(TARGET_HEALTHD_DRAW_SPLIT_SCREEN),)
37LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_SCREEN=$(TARGET_HEALTHD_DRAW_SPLIT_SCREEN)
38else
39LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_SCREEN=0
40endif
41
42ifneq ($(TARGET_HEALTHD_DRAW_SPLIT_OFFSET),)
43LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_OFFSET=$(TARGET_HEALTHD_DRAW_SPLIT_OFFSET)
44else
45LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_OFFSET=0
46endif
47
48include $(BUILD_STATIC_LIBRARY)
49
50include $(CLEAR_VARS)
51
Sandeep Patilfca82442016-11-01 08:29:30 -070052LOCAL_CFLAGS := -Werror
53ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
54LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
55endif
56ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
57LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
58endif
59
60LOCAL_SRC_FILES := \
61 healthd_mode_charger.cpp \
62 AnimationParser.cpp
63
64LOCAL_MODULE := libhealthd_charger
65LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include
66LOCAL_EXPORT_C_INCLUDE_DIRS := \
67 $(LOCAL_PATH) \
68 $(LOCAL_PATH)/include
69
70LOCAL_STATIC_LIBRARIES := \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070071 libminui \
72 libpng \
73 libz \
74 libutils \
75 libbase \
76 libcutils \
Luke Song7f386dc2017-07-13 15:10:35 -070077 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070078 liblog \
79 libm \
80 libc \
81
Sandeep Patilfca82442016-11-01 08:29:30 -070082ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
83LOCAL_STATIC_LIBRARIES += libsuspend
84endif
85
Damien Bargiacchi565ba022016-08-11 15:29:50 -070086include $(BUILD_STATIC_LIBRARY)
87
Sandeep Patil6012db52016-11-01 08:45:19 -070088### charger ###
Damien Bargiacchi565ba022016-08-11 15:29:50 -070089include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -080090ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
91LOCAL_CHARGER_NO_UI := true
92endif
Todd Poynor7c5a3e12016-02-12 19:53:15 -080093
Todd Poynor752faf22013-06-12 13:25:59 -070094LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -070095 healthd_common.cpp \
96 charger.cpp \
Todd Poynor7c5a3e12016-02-12 19:53:15 -080097
Sandeep Patil6012db52016-11-01 08:45:19 -070098LOCAL_MODULE := charger
Todd Poynor752faf22013-06-12 13:25:59 -070099LOCAL_MODULE_TAGS := optional
100LOCAL_FORCE_STATIC_EXECUTABLE := true
101LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
102LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
Sandeep Patilfca82442016-11-01 08:29:30 -0700103LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -0700104
Sandeep Patilfca82442016-11-01 08:29:30 -0700105LOCAL_CFLAGS := -Werror
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800106ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
107LOCAL_CFLAGS += -DCHARGER_NO_UI
108endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -0700109ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),)
110LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST)
111endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -0700112ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),)
113LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
114endif
115
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700116LOCAL_STATIC_LIBRARIES := \
Sandeep Patilfca82442016-11-01 08:29:30 -0700117 libhealthd_charger \
Luke Song7f386dc2017-07-13 15:10:35 -0700118 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700119 libbatterymonitor \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700120 libbase \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700121 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700122 libcutils \
123 liblog \
124 libm \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700125 libc \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700126
Sandeep Patilfca82442016-11-01 08:29:30 -0700127ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
128LOCAL_STATIC_LIBRARIES += \
129 libminui \
130 libpng \
131 libz \
132
133endif
134
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700135ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
136LOCAL_STATIC_LIBRARIES += libsuspend
137endif
138
Todd Poynord65104c2013-08-13 15:50:42 -0700139LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700140
Sandeep Patil6012db52016-11-01 08:45:19 -0700141# Symlink /charger to /sbin/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700142LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
Sandeep Patil6012db52016-11-01 08:45:19 -0700143 && ln -sf /sbin/charger $(TARGET_ROOT_OUT)/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700144
Todd Poynor752faf22013-06-12 13:25:59 -0700145include $(BUILD_EXECUTABLE)
146
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800147ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700148define _add-charger-image
149include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700150LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700151LOCAL_MODULE_STEM := $(notdir $(1))
152_img_modules += $$(LOCAL_MODULE)
153LOCAL_SRC_FILES := $1
154LOCAL_MODULE_TAGS := optional
155LOCAL_MODULE_CLASS := ETC
156LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
157include $$(BUILD_PREBUILT)
158endef
159
160_img_modules :=
161_images :=
162$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
163 $(eval $(call _add-charger-image,$(_img))))
164
165include $(CLEAR_VARS)
166LOCAL_MODULE := charger_res_images
167LOCAL_MODULE_TAGS := optional
168LOCAL_REQUIRED_MODULES := $(_img_modules)
169include $(BUILD_PHONY_PACKAGE)
170
171_add-charger-image :=
172_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800173endif # LOCAL_CHARGER_NO_UI
Sandeep Patil6012db52016-11-01 08:45:19 -0700174
175### healthd ###
176include $(CLEAR_VARS)
177
178LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -0700179 healthd_common.cpp \
180 healthd.cpp \
Sandeep Patil6012db52016-11-01 08:45:19 -0700181
182LOCAL_MODULE := healthd
183LOCAL_MODULE_TAGS := optional
184LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
185
186ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),)
187LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST)
188endif
189ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),)
190LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
191endif
192
193LOCAL_STATIC_LIBRARIES := \
194 libhealthd_android \
Sandeep Patil6012db52016-11-01 08:45:19 -0700195 libbatterymonitor \
196 libbatteryservice \
Sandeep Patila3681952016-11-08 16:27:54 -0800197 android.hardware.health@1.0-convert \
Sandeep Patil6012db52016-11-01 08:45:19 -0700198
199LOCAL_SHARED_LIBRARIES := \
200 libbinder \
201 libbase \
202 libutils \
203 libcutils \
204 liblog \
205 libm \
206 libc \
Yifan Hong62e840f2016-11-17 13:00:55 -0800207 libhidlbase \
208 libhidltransport \
Sandeep Patila3681952016-11-08 16:27:54 -0800209 android.hardware.health@1.0 \
Sandeep Patil6012db52016-11-01 08:45:19 -0700210
Sandeep Patil6012db52016-11-01 08:45:19 -0700211include $(BUILD_EXECUTABLE)