blob: d8668875d95a32c0e5be638d2a286386f63ca940 [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
Yabin Cuie98e1772016-02-17 12:21:34 -080012include $(BUILD_STATIC_LIBRARY)
13
14include $(CLEAR_VARS)
15LOCAL_SRC_FILES := BatteryMonitor.cpp
16LOCAL_MODULE := libbatterymonitor
17LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
18LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Christopher Wiley22399082016-04-12 09:21:51 -070019LOCAL_STATIC_LIBRARIES := libutils libbinder
Todd Poynord65104c2013-08-13 15:50:42 -070020include $(BUILD_STATIC_LIBRARY)
21
Todd Poynor752faf22013-06-12 13:25:59 -070022include $(CLEAR_VARS)
23
Todd Poynor7c5a3e12016-02-12 19:53:15 -080024ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
25LOCAL_CHARGER_NO_UI := true
26endif
27ifdef BRILLO
28LOCAL_CHARGER_NO_UI := true
29endif
30
Todd Poynor752faf22013-06-12 13:25:59 -070031LOCAL_SRC_FILES := \
32 healthd.cpp \
Todd Poynorc7464c92013-09-10 12:40:00 -070033 healthd_mode_android.cpp \
Todd Poynor752faf22013-06-12 13:25:59 -070034 BatteryPropertiesRegistrar.cpp
35
Todd Poynor7c5a3e12016-02-12 19:53:15 -080036ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
37LOCAL_SRC_FILES += healthd_mode_charger.cpp
38endif
39
Todd Poynor752faf22013-06-12 13:25:59 -070040LOCAL_MODULE := healthd
41LOCAL_MODULE_TAGS := optional
42LOCAL_FORCE_STATIC_EXECUTABLE := true
43LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
44LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
45
Mark Salyzyn6f5b47f2014-05-15 15:00:59 -070046LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror
Todd Poynorfea5b4d2013-09-09 12:09:08 -070047
48ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
49LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
50endif
51
52ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
53LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
54endif
55
Todd Poynor7c5a3e12016-02-12 19:53:15 -080056ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
57LOCAL_CFLAGS += -DCHARGER_NO_UI
58endif
59
Yabin Cuie98e1772016-02-17 12:21:34 -080060LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include
Todd Poynorfea5b4d2013-09-09 12:09:08 -070061
Yabin Cuie98e1772016-02-17 12:21:34 -080062LOCAL_STATIC_LIBRARIES := libbatterymonitor libbatteryservice libbinder
Todd Poynor7c5a3e12016-02-12 19:53:15 -080063
64ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
65LOCAL_STATIC_LIBRARIES += libminui libpng libz
66endif
67
68LOCAL_STATIC_LIBRARIES += libutils libcutils liblog libm libc
Todd Poynorfea5b4d2013-09-09 12:09:08 -070069
70ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
71LOCAL_STATIC_LIBRARIES += libsuspend
72endif
73
Todd Poynord65104c2013-08-13 15:50:42 -070074LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -070075
Ying Wangc4d6ade2013-09-20 10:37:42 -070076# Symlink /charger to /sbin/healthd
77LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
78 && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger
79
Todd Poynor752faf22013-06-12 13:25:59 -070080include $(BUILD_EXECUTABLE)
81
Todd Poynorfea5b4d2013-09-09 12:09:08 -070082
Todd Poynor7c5a3e12016-02-12 19:53:15 -080083ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -070084define _add-charger-image
85include $$(CLEAR_VARS)
86LOCAL_MODULE := system_core_charger_$(notdir $(1))
87LOCAL_MODULE_STEM := $(notdir $(1))
88_img_modules += $$(LOCAL_MODULE)
89LOCAL_SRC_FILES := $1
90LOCAL_MODULE_TAGS := optional
91LOCAL_MODULE_CLASS := ETC
92LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
93include $$(BUILD_PREBUILT)
94endef
95
96_img_modules :=
97_images :=
98$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
99 $(eval $(call _add-charger-image,$(_img))))
100
101include $(CLEAR_VARS)
102LOCAL_MODULE := charger_res_images
103LOCAL_MODULE_TAGS := optional
104LOCAL_REQUIRED_MODULES := $(_img_modules)
105include $(BUILD_PHONY_PACKAGE)
106
107_add-charger-image :=
108_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800109endif # LOCAL_CHARGER_NO_UI