blob: b292725b9cb432f3fb6ad19471302e6374c5aee5 [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)
6LOCAL_SRC_FILES := healthd_board_default.cpp
7LOCAL_MODULE := libhealthd.default
Mark Salyzyn6f5b47f2014-05-15 15:00:59 -07008LOCAL_CFLAGS := -Werror
Yabin Cuie98e1772016-02-17 12:21:34 -08009LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
10LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Christopher Wiley22399082016-04-12 09:21:51 -070011LOCAL_STATIC_LIBRARIES := libbinder
Christopher Wiley8ac71c72016-04-18 09:33:53 -070012LOCAL_EXPORT_STATIC_LIBRARY_HEADERS := libbinder
Yabin Cuie98e1772016-02-17 12:21:34 -080013include $(BUILD_STATIC_LIBRARY)
14
15include $(CLEAR_VARS)
16LOCAL_SRC_FILES := BatteryMonitor.cpp
17LOCAL_MODULE := libbatterymonitor
18LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
19LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Michael Scott3217c5c2016-06-05 11:20:13 -070020LOCAL_STATIC_LIBRARIES := libutils libbase libbinder
Todd Poynord65104c2013-08-13 15:50:42 -070021include $(BUILD_STATIC_LIBRARY)
22
Todd Poynor752faf22013-06-12 13:25:59 -070023include $(CLEAR_VARS)
Nick Vaccaroe3083de2016-10-24 13:35:47 -070024ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
25LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
26LOCAL_SHARED_LIBRARIES += libsuspend
27endif
Damien Bargiacchi565ba022016-08-11 15:29:50 -070028LOCAL_SRC_FILES := \
29 healthd_mode_android.cpp \
30 healthd_mode_charger.cpp \
31 AnimationParser.cpp \
32 BatteryPropertiesRegistrar.cpp \
33
34LOCAL_MODULE := libhealthd_internal
35LOCAL_C_INCLUDES := bootable/recovery
36LOCAL_EXPORT_C_INCLUDE_DIRS := \
37 $(LOCAL_PATH) \
38 $(LOCAL_PATH)/include \
39
40LOCAL_STATIC_LIBRARIES := \
41 libbatterymonitor \
42 libbatteryservice \
43 libbinder \
44 libminui \
45 libpng \
46 libz \
47 libutils \
48 libbase \
49 libcutils \
50 liblog \
51 libm \
52 libc \
53
54include $(BUILD_STATIC_LIBRARY)
55
56
57include $(CLEAR_VARS)
Todd Poynor752faf22013-06-12 13:25:59 -070058
Todd Poynor7c5a3e12016-02-12 19:53:15 -080059ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
60LOCAL_CHARGER_NO_UI := true
61endif
62ifdef BRILLO
63LOCAL_CHARGER_NO_UI := true
64endif
65
Todd Poynor752faf22013-06-12 13:25:59 -070066LOCAL_SRC_FILES := \
67 healthd.cpp \
Todd Poynorc7464c92013-09-10 12:40:00 -070068 healthd_mode_android.cpp \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -070069 BatteryPropertiesRegistrar.cpp \
Todd Poynor752faf22013-06-12 13:25:59 -070070
Todd Poynor7c5a3e12016-02-12 19:53:15 -080071ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
72LOCAL_SRC_FILES += healthd_mode_charger.cpp
73endif
74
Todd Poynor752faf22013-06-12 13:25:59 -070075LOCAL_MODULE := healthd
76LOCAL_MODULE_TAGS := optional
77LOCAL_FORCE_STATIC_EXECUTABLE := true
78LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
79LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
80
Mark Salyzyn6f5b47f2014-05-15 15:00:59 -070081LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror
Todd Poynorfea5b4d2013-09-09 12:09:08 -070082
83ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
84LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
85endif
86
87ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
88LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
89endif
90
Todd Poynor7c5a3e12016-02-12 19:53:15 -080091ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
92LOCAL_CFLAGS += -DCHARGER_NO_UI
93endif
94
Yabin Cuie98e1772016-02-17 12:21:34 -080095LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include
Todd Poynorfea5b4d2013-09-09 12:09:08 -070096
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070097ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),)
98LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST)
99endif
100
101ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),)
102LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
103endif
104
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700105LOCAL_STATIC_LIBRARIES := \
106 libhealthd_internal \
107 libbatterymonitor \
108 libbatteryservice \
109 libbinder \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700110 libbase \
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800111
112ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700113LOCAL_STATIC_LIBRARIES += \
114 libminui \
115 libpng \
116 libz \
117
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800118endif
119
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700120
121LOCAL_STATIC_LIBRARIES += \
122 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700123 libcutils \
124 liblog \
125 libm \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700126 libc \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700127
128ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
129LOCAL_STATIC_LIBRARIES += libsuspend
130endif
131
Todd Poynord65104c2013-08-13 15:50:42 -0700132LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700133
Ying Wangc4d6ade2013-09-20 10:37:42 -0700134# Symlink /charger to /sbin/healthd
135LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
136 && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger
137
Todd Poynor752faf22013-06-12 13:25:59 -0700138include $(BUILD_EXECUTABLE)
139
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700140
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800141ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700142define _add-charger-image
143include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700144LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700145LOCAL_MODULE_STEM := $(notdir $(1))
146_img_modules += $$(LOCAL_MODULE)
147LOCAL_SRC_FILES := $1
148LOCAL_MODULE_TAGS := optional
149LOCAL_MODULE_CLASS := ETC
150LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
151include $$(BUILD_PREBUILT)
152endef
153
154_img_modules :=
155_images :=
156$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
157 $(eval $(call _add-charger-image,$(_img))))
158
159include $(CLEAR_VARS)
160LOCAL_MODULE := charger_res_images
161LOCAL_MODULE_TAGS := optional
162LOCAL_REQUIRED_MODULES := $(_img_modules)
163include $(BUILD_PHONY_PACKAGE)
164
165_add-charger-image :=
166_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800167endif # LOCAL_CHARGER_NO_UI