blob: ddd9f1f02f83af9bc08658dcf370070ce8b3f586 [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
11include $(BUILD_STATIC_LIBRARY)
12
13include $(CLEAR_VARS)
14LOCAL_SRC_FILES := BatteryMonitor.cpp
15LOCAL_MODULE := libbatterymonitor
16LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
17LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
18LOCAL_STATIC_LIBRARIES := libutils
Todd Poynord65104c2013-08-13 15:50:42 -070019include $(BUILD_STATIC_LIBRARY)
20
Todd Poynor752faf22013-06-12 13:25:59 -070021include $(CLEAR_VARS)
22
Todd Poynor7c5a3e12016-02-12 19:53:15 -080023ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
24LOCAL_CHARGER_NO_UI := true
25endif
26ifdef BRILLO
27LOCAL_CHARGER_NO_UI := true
28endif
29
Todd Poynor752faf22013-06-12 13:25:59 -070030LOCAL_SRC_FILES := \
31 healthd.cpp \
Todd Poynorc7464c92013-09-10 12:40:00 -070032 healthd_mode_android.cpp \
Todd Poynor752faf22013-06-12 13:25:59 -070033 BatteryPropertiesRegistrar.cpp
34
Todd Poynor7c5a3e12016-02-12 19:53:15 -080035ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
36LOCAL_SRC_FILES += healthd_mode_charger.cpp
37endif
38
Todd Poynor752faf22013-06-12 13:25:59 -070039LOCAL_MODULE := healthd
40LOCAL_MODULE_TAGS := optional
41LOCAL_FORCE_STATIC_EXECUTABLE := true
42LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
43LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
44
Mark Salyzyn6f5b47f2014-05-15 15:00:59 -070045LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror
Todd Poynorfea5b4d2013-09-09 12:09:08 -070046
47ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
48LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
49endif
50
51ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
52LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
53endif
54
Todd Poynor7c5a3e12016-02-12 19:53:15 -080055ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
56LOCAL_CFLAGS += -DCHARGER_NO_UI
57endif
58
Yabin Cuie98e1772016-02-17 12:21:34 -080059LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include
Todd Poynorfea5b4d2013-09-09 12:09:08 -070060
Yabin Cuie98e1772016-02-17 12:21:34 -080061LOCAL_STATIC_LIBRARIES := libbatterymonitor libbatteryservice libbinder
Todd Poynor7c5a3e12016-02-12 19:53:15 -080062
63ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
64LOCAL_STATIC_LIBRARIES += libminui libpng libz
65endif
66
67LOCAL_STATIC_LIBRARIES += libutils libcutils liblog libm libc
Todd Poynorfea5b4d2013-09-09 12:09:08 -070068
69ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
70LOCAL_STATIC_LIBRARIES += libsuspend
71endif
72
Todd Poynord65104c2013-08-13 15:50:42 -070073LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -070074
Ying Wangc4d6ade2013-09-20 10:37:42 -070075# Symlink /charger to /sbin/healthd
76LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
77 && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger
78
Todd Poynor752faf22013-06-12 13:25:59 -070079include $(BUILD_EXECUTABLE)
80
Todd Poynorfea5b4d2013-09-09 12:09:08 -070081
Todd Poynor7c5a3e12016-02-12 19:53:15 -080082ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -070083define _add-charger-image
84include $$(CLEAR_VARS)
85LOCAL_MODULE := system_core_charger_$(notdir $(1))
86LOCAL_MODULE_STEM := $(notdir $(1))
87_img_modules += $$(LOCAL_MODULE)
88LOCAL_SRC_FILES := $1
89LOCAL_MODULE_TAGS := optional
90LOCAL_MODULE_CLASS := ETC
91LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
92include $$(BUILD_PREBUILT)
93endef
94
95_img_modules :=
96_images :=
97$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
98 $(eval $(call _add-charger-image,$(_img))))
99
100include $(CLEAR_VARS)
101LOCAL_MODULE := charger_res_images
102LOCAL_MODULE_TAGS := optional
103LOCAL_REQUIRED_MODULES := $(_img_modules)
104include $(BUILD_PHONY_PACKAGE)
105
106_add-charger-image :=
107_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800108endif # LOCAL_CHARGER_NO_UI