blob: 127f39e90de6055d1c39653fecec736871def637 [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
Christopher Wiley22399082016-04-12 09:21:51 -070020LOCAL_STATIC_LIBRARIES := libutils libbinder
Todd Poynord65104c2013-08-13 15:50:42 -070021include $(BUILD_STATIC_LIBRARY)
22
Todd Poynor752faf22013-06-12 13:25:59 -070023include $(CLEAR_VARS)
24
Todd Poynor7c5a3e12016-02-12 19:53:15 -080025ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
26LOCAL_CHARGER_NO_UI := true
27endif
28ifdef BRILLO
29LOCAL_CHARGER_NO_UI := true
30endif
31
Todd Poynor752faf22013-06-12 13:25:59 -070032LOCAL_SRC_FILES := \
33 healthd.cpp \
Todd Poynorc7464c92013-09-10 12:40:00 -070034 healthd_mode_android.cpp \
Todd Poynor752faf22013-06-12 13:25:59 -070035 BatteryPropertiesRegistrar.cpp
36
Todd Poynor7c5a3e12016-02-12 19:53:15 -080037ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
38LOCAL_SRC_FILES += healthd_mode_charger.cpp
39endif
40
Todd Poynor752faf22013-06-12 13:25:59 -070041LOCAL_MODULE := healthd
42LOCAL_MODULE_TAGS := optional
43LOCAL_FORCE_STATIC_EXECUTABLE := true
44LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
45LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
46
Mark Salyzyn6f5b47f2014-05-15 15:00:59 -070047LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror
Todd Poynorfea5b4d2013-09-09 12:09:08 -070048
49ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
50LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
51endif
52
53ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
54LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
55endif
56
Todd Poynor7c5a3e12016-02-12 19:53:15 -080057ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
58LOCAL_CFLAGS += -DCHARGER_NO_UI
59endif
60
Yabin Cuie98e1772016-02-17 12:21:34 -080061LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include
Todd Poynorfea5b4d2013-09-09 12:09:08 -070062
Yabin Cuie98e1772016-02-17 12:21:34 -080063LOCAL_STATIC_LIBRARIES := libbatterymonitor libbatteryservice libbinder
Todd Poynor7c5a3e12016-02-12 19:53:15 -080064
65ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
66LOCAL_STATIC_LIBRARIES += libminui libpng libz
67endif
68
69LOCAL_STATIC_LIBRARIES += libutils libcutils liblog libm libc
Todd Poynorfea5b4d2013-09-09 12:09:08 -070070
71ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
72LOCAL_STATIC_LIBRARIES += libsuspend
73endif
74
Todd Poynord65104c2013-08-13 15:50:42 -070075LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -070076
Ying Wangc4d6ade2013-09-20 10:37:42 -070077# Symlink /charger to /sbin/healthd
78LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
79 && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger
80
Todd Poynor752faf22013-06-12 13:25:59 -070081include $(BUILD_EXECUTABLE)
82
Todd Poynorfea5b4d2013-09-09 12:09:08 -070083
Todd Poynor7c5a3e12016-02-12 19:53:15 -080084ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -070085define _add-charger-image
86include $$(CLEAR_VARS)
87LOCAL_MODULE := system_core_charger_$(notdir $(1))
88LOCAL_MODULE_STEM := $(notdir $(1))
89_img_modules += $$(LOCAL_MODULE)
90LOCAL_SRC_FILES := $1
91LOCAL_MODULE_TAGS := optional
92LOCAL_MODULE_CLASS := ETC
93LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
94include $$(BUILD_PREBUILT)
95endef
96
97_img_modules :=
98_images :=
99$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
100 $(eval $(call _add-charger-image,$(_img))))
101
102include $(CLEAR_VARS)
103LOCAL_MODULE := charger_res_images
104LOCAL_MODULE_TAGS := optional
105LOCAL_REQUIRED_MODULES := $(_img_modules)
106include $(BUILD_PHONY_PACKAGE)
107
108_add-charger-image :=
109_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800110endif # LOCAL_CHARGER_NO_UI