Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 1 | # Copyright 2013 The Android Open Source Project |
| 2 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 3 | LOCAL_PATH := $(call my-dir) |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 4 | |
| 5 | include $(CLEAR_VARS) |
| 6 | LOCAL_SRC_FILES := healthd_board_default.cpp |
| 7 | LOCAL_MODULE := libhealthd.default |
Mark Salyzyn | 6f5b47f | 2014-05-15 15:00:59 -0700 | [diff] [blame] | 8 | LOCAL_CFLAGS := -Werror |
Yabin Cui | e98e177 | 2016-02-17 12:21:34 -0800 | [diff] [blame^] | 9 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 10 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
| 11 | include $(BUILD_STATIC_LIBRARY) |
| 12 | |
| 13 | include $(CLEAR_VARS) |
| 14 | LOCAL_SRC_FILES := BatteryMonitor.cpp |
| 15 | LOCAL_MODULE := libbatterymonitor |
| 16 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 17 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
| 18 | LOCAL_STATIC_LIBRARIES := libutils |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 19 | include $(BUILD_STATIC_LIBRARY) |
| 20 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 21 | include $(CLEAR_VARS) |
| 22 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 23 | ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true) |
| 24 | LOCAL_CHARGER_NO_UI := true |
| 25 | endif |
| 26 | ifdef BRILLO |
| 27 | LOCAL_CHARGER_NO_UI := true |
| 28 | endif |
| 29 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 30 | LOCAL_SRC_FILES := \ |
| 31 | healthd.cpp \ |
Todd Poynor | c7464c9 | 2013-09-10 12:40:00 -0700 | [diff] [blame] | 32 | healthd_mode_android.cpp \ |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 33 | BatteryPropertiesRegistrar.cpp |
| 34 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 35 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
| 36 | LOCAL_SRC_FILES += healthd_mode_charger.cpp |
| 37 | endif |
| 38 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 39 | LOCAL_MODULE := healthd |
| 40 | LOCAL_MODULE_TAGS := optional |
| 41 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 42 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) |
| 43 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) |
| 44 | |
Mark Salyzyn | 6f5b47f | 2014-05-15 15:00:59 -0700 | [diff] [blame] | 45 | LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 46 | |
| 47 | ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true) |
| 48 | LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK |
| 49 | endif |
| 50 | |
| 51 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 52 | LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND |
| 53 | endif |
| 54 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 55 | ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
| 56 | LOCAL_CFLAGS += -DCHARGER_NO_UI |
| 57 | endif |
| 58 | |
Yabin Cui | e98e177 | 2016-02-17 12:21:34 -0800 | [diff] [blame^] | 59 | LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 60 | |
Yabin Cui | e98e177 | 2016-02-17 12:21:34 -0800 | [diff] [blame^] | 61 | LOCAL_STATIC_LIBRARIES := libbatterymonitor libbatteryservice libbinder |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 62 | |
| 63 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
| 64 | LOCAL_STATIC_LIBRARIES += libminui libpng libz |
| 65 | endif |
| 66 | |
| 67 | LOCAL_STATIC_LIBRARIES += libutils libcutils liblog libm libc |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 68 | |
| 69 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 70 | LOCAL_STATIC_LIBRARIES += libsuspend |
| 71 | endif |
| 72 | |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 73 | LOCAL_HAL_STATIC_LIBRARIES := libhealthd |
Todd Poynor | 10b235e | 2013-08-07 15:25:14 -0700 | [diff] [blame] | 74 | |
Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 75 | # Symlink /charger to /sbin/healthd |
| 76 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \ |
| 77 | && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger |
| 78 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 79 | include $(BUILD_EXECUTABLE) |
| 80 | |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 81 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 82 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 83 | define _add-charger-image |
| 84 | include $$(CLEAR_VARS) |
| 85 | LOCAL_MODULE := system_core_charger_$(notdir $(1)) |
| 86 | LOCAL_MODULE_STEM := $(notdir $(1)) |
| 87 | _img_modules += $$(LOCAL_MODULE) |
| 88 | LOCAL_SRC_FILES := $1 |
| 89 | LOCAL_MODULE_TAGS := optional |
| 90 | LOCAL_MODULE_CLASS := ETC |
| 91 | LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger |
| 92 | include $$(BUILD_PREBUILT) |
| 93 | endef |
| 94 | |
| 95 | _img_modules := |
| 96 | _images := |
| 97 | $(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \ |
| 98 | $(eval $(call _add-charger-image,$(_img)))) |
| 99 | |
| 100 | include $(CLEAR_VARS) |
| 101 | LOCAL_MODULE := charger_res_images |
| 102 | LOCAL_MODULE_TAGS := optional |
| 103 | LOCAL_REQUIRED_MODULES := $(_img_modules) |
| 104 | include $(BUILD_PHONY_PACKAGE) |
| 105 | |
| 106 | _add-charger-image := |
| 107 | _img_modules := |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 108 | endif # LOCAL_CHARGER_NO_UI |