blob: 5d207e37eecd770113e930355dec1d93c2add893 [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
Todd Poynord65104c2013-08-13 15:50:42 -07009include $(BUILD_STATIC_LIBRARY)
10
Todd Poynor752faf22013-06-12 13:25:59 -070011include $(CLEAR_VARS)
12
Todd Poynor7c5a3e12016-02-12 19:53:15 -080013ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
14LOCAL_CHARGER_NO_UI := true
15endif
16ifdef BRILLO
17LOCAL_CHARGER_NO_UI := true
18endif
19
Todd Poynor752faf22013-06-12 13:25:59 -070020LOCAL_SRC_FILES := \
21 healthd.cpp \
Todd Poynorc7464c92013-09-10 12:40:00 -070022 healthd_mode_android.cpp \
Todd Poynor752faf22013-06-12 13:25:59 -070023 BatteryMonitor.cpp \
24 BatteryPropertiesRegistrar.cpp
25
Todd Poynor7c5a3e12016-02-12 19:53:15 -080026ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
27LOCAL_SRC_FILES += healthd_mode_charger.cpp
28endif
29
Todd Poynor752faf22013-06-12 13:25:59 -070030LOCAL_MODULE := healthd
31LOCAL_MODULE_TAGS := optional
32LOCAL_FORCE_STATIC_EXECUTABLE := true
33LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
34LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
35
Mark Salyzyn6f5b47f2014-05-15 15:00:59 -070036LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror
Todd Poynorfea5b4d2013-09-09 12:09:08 -070037
38ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
39LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
40endif
41
42ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
43LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
44endif
45
Todd Poynor7c5a3e12016-02-12 19:53:15 -080046ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
47LOCAL_CFLAGS += -DCHARGER_NO_UI
48endif
49
Todd Poynorfea5b4d2013-09-09 12:09:08 -070050LOCAL_C_INCLUDES := bootable/recovery
51
Todd Poynor7c5a3e12016-02-12 19:53:15 -080052LOCAL_STATIC_LIBRARIES := libbatteryservice libbinder
53
54ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
55LOCAL_STATIC_LIBRARIES += libminui libpng libz
56endif
57
58LOCAL_STATIC_LIBRARIES += libutils libcutils liblog libm libc
Todd Poynorfea5b4d2013-09-09 12:09:08 -070059
60ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
61LOCAL_STATIC_LIBRARIES += libsuspend
62endif
63
Todd Poynord65104c2013-08-13 15:50:42 -070064LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -070065
Ying Wangc4d6ade2013-09-20 10:37:42 -070066# Symlink /charger to /sbin/healthd
67LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
68 && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger
69
Todd Poynor752faf22013-06-12 13:25:59 -070070include $(BUILD_EXECUTABLE)
71
Todd Poynorfea5b4d2013-09-09 12:09:08 -070072
Todd Poynor7c5a3e12016-02-12 19:53:15 -080073ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -070074define _add-charger-image
75include $$(CLEAR_VARS)
76LOCAL_MODULE := system_core_charger_$(notdir $(1))
77LOCAL_MODULE_STEM := $(notdir $(1))
78_img_modules += $$(LOCAL_MODULE)
79LOCAL_SRC_FILES := $1
80LOCAL_MODULE_TAGS := optional
81LOCAL_MODULE_CLASS := ETC
82LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
83include $$(BUILD_PREBUILT)
84endef
85
86_img_modules :=
87_images :=
88$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
89 $(eval $(call _add-charger-image,$(_img))))
90
91include $(CLEAR_VARS)
92LOCAL_MODULE := charger_res_images
93LOCAL_MODULE_TAGS := optional
94LOCAL_REQUIRED_MODULES := $(_img_modules)
95include $(BUILD_PHONY_PACKAGE)
96
97_add-charger-image :=
98_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -080099endif # LOCAL_CHARGER_NO_UI