blob: 8b5996442634f9c97c903730bbe8699fd0eb6bbd [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
36LOCAL_CFLAGS := -Werror
37ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
38LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
39endif
40ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
41LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
42endif
43
44LOCAL_SRC_FILES := \
45 healthd_mode_charger.cpp \
46 AnimationParser.cpp
47
48LOCAL_MODULE := libhealthd_charger
49LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include
50LOCAL_EXPORT_C_INCLUDE_DIRS := \
51 $(LOCAL_PATH) \
52 $(LOCAL_PATH)/include
53
54LOCAL_STATIC_LIBRARIES := \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070055 libminui \
56 libpng \
57 libz \
58 libutils \
59 libbase \
60 libcutils \
61 liblog \
62 libm \
63 libc \
64
Sandeep Patilfca82442016-11-01 08:29:30 -070065ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
66LOCAL_STATIC_LIBRARIES += libsuspend
67endif
68
Damien Bargiacchi565ba022016-08-11 15:29:50 -070069include $(BUILD_STATIC_LIBRARY)
70
Sandeep Patil6012db52016-11-01 08:45:19 -070071### charger ###
Damien Bargiacchi565ba022016-08-11 15:29:50 -070072include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -080073ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
74LOCAL_CHARGER_NO_UI := true
75endif
76ifdef BRILLO
77LOCAL_CHARGER_NO_UI := true
78endif
79
Todd Poynor752faf22013-06-12 13:25:59 -070080LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -070081 healthd_common.cpp \
82 charger.cpp \
Todd Poynor7c5a3e12016-02-12 19:53:15 -080083
Sandeep Patil6012db52016-11-01 08:45:19 -070084LOCAL_MODULE := charger
Todd Poynor752faf22013-06-12 13:25:59 -070085LOCAL_MODULE_TAGS := optional
86LOCAL_FORCE_STATIC_EXECUTABLE := true
87LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
88LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
Sandeep Patilfca82442016-11-01 08:29:30 -070089LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -070090
Sandeep Patilfca82442016-11-01 08:29:30 -070091LOCAL_CFLAGS := -Werror
Todd Poynor7c5a3e12016-02-12 19:53:15 -080092ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
93LOCAL_CFLAGS += -DCHARGER_NO_UI
94endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070095ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),)
96LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST)
97endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070098ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),)
99LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
100endif
101
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700102LOCAL_STATIC_LIBRARIES := \
Sandeep Patilfca82442016-11-01 08:29:30 -0700103 libhealthd_charger \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700104 libbatterymonitor \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700105 libbase \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700106 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700107 libcutils \
108 liblog \
109 libm \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700110 libc \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700111
Sandeep Patilfca82442016-11-01 08:29:30 -0700112ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
113LOCAL_STATIC_LIBRARIES += \
114 libminui \
115 libpng \
116 libz \
117
118endif
119
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700120ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
121LOCAL_STATIC_LIBRARIES += libsuspend
122endif
123
Todd Poynord65104c2013-08-13 15:50:42 -0700124LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700125
Sandeep Patil6012db52016-11-01 08:45:19 -0700126# Symlink /charger to /sbin/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700127LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
Sandeep Patil6012db52016-11-01 08:45:19 -0700128 && ln -sf /sbin/charger $(TARGET_ROOT_OUT)/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700129
Todd Poynor752faf22013-06-12 13:25:59 -0700130include $(BUILD_EXECUTABLE)
131
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800132ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700133define _add-charger-image
134include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700135LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700136LOCAL_MODULE_STEM := $(notdir $(1))
137_img_modules += $$(LOCAL_MODULE)
138LOCAL_SRC_FILES := $1
139LOCAL_MODULE_TAGS := optional
140LOCAL_MODULE_CLASS := ETC
141LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
142include $$(BUILD_PREBUILT)
143endef
144
145_img_modules :=
146_images :=
147$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
148 $(eval $(call _add-charger-image,$(_img))))
149
150include $(CLEAR_VARS)
151LOCAL_MODULE := charger_res_images
152LOCAL_MODULE_TAGS := optional
153LOCAL_REQUIRED_MODULES := $(_img_modules)
154include $(BUILD_PHONY_PACKAGE)
155
156_add-charger-image :=
157_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800158endif # LOCAL_CHARGER_NO_UI
Sandeep Patil6012db52016-11-01 08:45:19 -0700159
160### healthd ###
161include $(CLEAR_VARS)
162
163LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -0700164 healthd_common.cpp \
165 healthd.cpp \
Sandeep Patil6012db52016-11-01 08:45:19 -0700166
167LOCAL_MODULE := healthd
168LOCAL_MODULE_TAGS := optional
169LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
170
171ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),)
172LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST)
173endif
174ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),)
175LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
176endif
177
178LOCAL_STATIC_LIBRARIES := \
179 libhealthd_android \
Sandeep Patil6012db52016-11-01 08:45:19 -0700180 libbatterymonitor \
181 libbatteryservice \
Sandeep Patila3681952016-11-08 16:27:54 -0800182 android.hardware.health@1.0-convert \
Sandeep Patil6012db52016-11-01 08:45:19 -0700183
184LOCAL_SHARED_LIBRARIES := \
185 libbinder \
186 libbase \
187 libutils \
188 libcutils \
189 liblog \
190 libm \
191 libc \
Yifan Hong62e840f2016-11-17 13:00:55 -0800192 libhidlbase \
193 libhidltransport \
Sandeep Patila3681952016-11-08 16:27:54 -0800194 android.hardware.health@1.0 \
Sandeep Patil6012db52016-11-01 08:45:19 -0700195
Sandeep Patil6012db52016-11-01 08:45:19 -0700196include $(BUILD_EXECUTABLE)