blob: 49873aab7fdefd151c7ef1f7325e682b88bbae5d [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)
Damien Bargiacchi565ba022016-08-11 15:29:50 -070024LOCAL_SRC_FILES := \
25 healthd_mode_android.cpp \
Sandeep Patilfca82442016-11-01 08:29:30 -070026 BatteryPropertiesRegistrar.cpp
Damien Bargiacchi565ba022016-08-11 15:29:50 -070027
Sandeep Patilfca82442016-11-01 08:29:30 -070028LOCAL_MODULE := libhealthd_android
Damien Bargiacchi565ba022016-08-11 15:29:50 -070029LOCAL_EXPORT_C_INCLUDE_DIRS := \
30 $(LOCAL_PATH) \
Sandeep Patilfca82442016-11-01 08:29:30 -070031 $(LOCAL_PATH)/include
Damien Bargiacchi565ba022016-08-11 15:29:50 -070032
33LOCAL_STATIC_LIBRARIES := \
34 libbatterymonitor \
35 libbatteryservice \
Sandeep Patilfca82442016-11-01 08:29:30 -070036 libutils \
37 libbase \
38 libcutils \
39 liblog \
40 libc \
41
42include $(BUILD_STATIC_LIBRARY)
43
44include $(CLEAR_VARS)
45
46LOCAL_CFLAGS := -Werror
47ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
48LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
49endif
50ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
51LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
52endif
53
54LOCAL_SRC_FILES := \
55 healthd_mode_charger.cpp \
56 AnimationParser.cpp
57
58LOCAL_MODULE := libhealthd_charger
59LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include
60LOCAL_EXPORT_C_INCLUDE_DIRS := \
61 $(LOCAL_PATH) \
62 $(LOCAL_PATH)/include
63
64LOCAL_STATIC_LIBRARIES := \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070065 libminui \
66 libpng \
67 libz \
68 libutils \
69 libbase \
70 libcutils \
71 liblog \
72 libm \
73 libc \
74
Sandeep Patilfca82442016-11-01 08:29:30 -070075ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
76LOCAL_STATIC_LIBRARIES += libsuspend
77endif
78
Damien Bargiacchi565ba022016-08-11 15:29:50 -070079include $(BUILD_STATIC_LIBRARY)
80
Damien Bargiacchi565ba022016-08-11 15:29:50 -070081include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -080082ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
83LOCAL_CHARGER_NO_UI := true
84endif
85ifdef BRILLO
86LOCAL_CHARGER_NO_UI := true
87endif
88
Todd Poynor752faf22013-06-12 13:25:59 -070089LOCAL_SRC_FILES := \
Sandeep Patilfca82442016-11-01 08:29:30 -070090 healthd.cpp
Todd Poynor7c5a3e12016-02-12 19:53:15 -080091
Todd Poynor752faf22013-06-12 13:25:59 -070092LOCAL_MODULE := healthd
93LOCAL_MODULE_TAGS := optional
94LOCAL_FORCE_STATIC_EXECUTABLE := true
95LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
96LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
Sandeep Patilfca82442016-11-01 08:29:30 -070097LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -070098
Sandeep Patilfca82442016-11-01 08:29:30 -070099LOCAL_CFLAGS := -Werror
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800100ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
101LOCAL_CFLAGS += -DCHARGER_NO_UI
102endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -0700103ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),)
104LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST)
105endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -0700106ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),)
107LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
108endif
109
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700110LOCAL_STATIC_LIBRARIES := \
Sandeep Patilfca82442016-11-01 08:29:30 -0700111 libhealthd_android \
112 libhealthd_charger \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700113 libbatterymonitor \
114 libbatteryservice \
115 libbinder \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700116 libbase \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700117 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700118 libcutils \
119 liblog \
120 libm \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700121 libc \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700122
Sandeep Patilfca82442016-11-01 08:29:30 -0700123ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
124LOCAL_STATIC_LIBRARIES += \
125 libminui \
126 libpng \
127 libz \
128
129endif
130
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700131ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
132LOCAL_STATIC_LIBRARIES += libsuspend
133endif
134
Todd Poynord65104c2013-08-13 15:50:42 -0700135LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700136
Ying Wangc4d6ade2013-09-20 10:37:42 -0700137# Symlink /charger to /sbin/healthd
138LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
139 && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger
140
Todd Poynor752faf22013-06-12 13:25:59 -0700141include $(BUILD_EXECUTABLE)
142
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700143
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800144ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700145define _add-charger-image
146include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700147LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700148LOCAL_MODULE_STEM := $(notdir $(1))
149_img_modules += $$(LOCAL_MODULE)
150LOCAL_SRC_FILES := $1
151LOCAL_MODULE_TAGS := optional
152LOCAL_MODULE_CLASS := ETC
153LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
154include $$(BUILD_PREBUILT)
155endef
156
157_img_modules :=
158_images :=
159$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
160 $(eval $(call _add-charger-image,$(_img))))
161
162include $(CLEAR_VARS)
163LOCAL_MODULE := charger_res_images
164LOCAL_MODULE_TAGS := optional
165LOCAL_REQUIRED_MODULES := $(_img_modules)
166include $(BUILD_PHONY_PACKAGE)
167
168_add-charger-image :=
169_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800170endif # LOCAL_CHARGER_NO_UI