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 |
Christopher Wiley | 2239908 | 2016-04-12 09:21:51 -0700 | [diff] [blame] | 11 | LOCAL_STATIC_LIBRARIES := libbinder |
Christopher Wiley | 8ac71c7 | 2016-04-18 09:33:53 -0700 | [diff] [blame] | 12 | LOCAL_EXPORT_STATIC_LIBRARY_HEADERS := libbinder |
Yabin Cui | e98e177 | 2016-02-17 12:21:34 -0800 | [diff] [blame] | 13 | include $(BUILD_STATIC_LIBRARY) |
| 14 | |
| 15 | include $(CLEAR_VARS) |
| 16 | LOCAL_SRC_FILES := BatteryMonitor.cpp |
| 17 | LOCAL_MODULE := libbatterymonitor |
| 18 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 19 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Michael Scott | 3217c5c | 2016-06-05 11:20:13 -0700 | [diff] [blame] | 20 | LOCAL_STATIC_LIBRARIES := libutils libbase libbinder |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 21 | include $(BUILD_STATIC_LIBRARY) |
| 22 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 23 | include $(CLEAR_VARS) |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 24 | LOCAL_SRC_FILES := \ |
| 25 | healthd_mode_android.cpp \ |
| 26 | healthd_mode_charger.cpp \ |
| 27 | AnimationParser.cpp \ |
| 28 | BatteryPropertiesRegistrar.cpp \ |
| 29 | |
| 30 | LOCAL_MODULE := libhealthd_internal |
| 31 | LOCAL_C_INCLUDES := bootable/recovery |
| 32 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ |
| 33 | $(LOCAL_PATH) \ |
| 34 | $(LOCAL_PATH)/include \ |
| 35 | |
| 36 | LOCAL_STATIC_LIBRARIES := \ |
| 37 | libbatterymonitor \ |
| 38 | libbatteryservice \ |
| 39 | libbinder \ |
| 40 | libminui \ |
| 41 | libpng \ |
| 42 | libz \ |
| 43 | libutils \ |
| 44 | libbase \ |
| 45 | libcutils \ |
| 46 | liblog \ |
| 47 | libm \ |
| 48 | libc \ |
| 49 | |
| 50 | include $(BUILD_STATIC_LIBRARY) |
| 51 | |
| 52 | |
| 53 | include $(CLEAR_VARS) |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 54 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 55 | ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true) |
| 56 | LOCAL_CHARGER_NO_UI := true |
| 57 | endif |
| 58 | ifdef BRILLO |
| 59 | LOCAL_CHARGER_NO_UI := true |
| 60 | endif |
| 61 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 62 | LOCAL_SRC_FILES := \ |
| 63 | healthd.cpp \ |
Todd Poynor | c7464c9 | 2013-09-10 12:40:00 -0700 | [diff] [blame] | 64 | healthd_mode_android.cpp \ |
Damien Bargiacchi | afd59e2 | 2016-09-13 08:37:37 -0700 | [diff] [blame] | 65 | BatteryPropertiesRegistrar.cpp \ |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 66 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 67 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
| 68 | LOCAL_SRC_FILES += healthd_mode_charger.cpp |
| 69 | endif |
| 70 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 71 | LOCAL_MODULE := healthd |
| 72 | LOCAL_MODULE_TAGS := optional |
| 73 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 74 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) |
| 75 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) |
| 76 | |
Mark Salyzyn | 6f5b47f | 2014-05-15 15:00:59 -0700 | [diff] [blame] | 77 | LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 78 | |
| 79 | ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true) |
| 80 | LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK |
| 81 | endif |
| 82 | |
| 83 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 84 | LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND |
| 85 | endif |
| 86 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 87 | ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
| 88 | LOCAL_CFLAGS += -DCHARGER_NO_UI |
| 89 | endif |
| 90 | |
Yabin Cui | e98e177 | 2016-02-17 12:21:34 -0800 | [diff] [blame] | 91 | LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 92 | |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 93 | LOCAL_STATIC_LIBRARIES := \ |
| 94 | libhealthd_internal \ |
| 95 | libbatterymonitor \ |
| 96 | libbatteryservice \ |
| 97 | libbinder \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 98 | libbase \ |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 99 | |
| 100 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
Damien Bargiacchi | afd59e2 | 2016-09-13 08:37:37 -0700 | [diff] [blame] | 101 | LOCAL_STATIC_LIBRARIES += \ |
| 102 | libminui \ |
| 103 | libpng \ |
| 104 | libz \ |
| 105 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 106 | endif |
| 107 | |
Damien Bargiacchi | afd59e2 | 2016-09-13 08:37:37 -0700 | [diff] [blame] | 108 | |
| 109 | LOCAL_STATIC_LIBRARIES += \ |
| 110 | libutils \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 111 | libcutils \ |
| 112 | liblog \ |
| 113 | libm \ |
Damien Bargiacchi | afd59e2 | 2016-09-13 08:37:37 -0700 | [diff] [blame] | 114 | libc \ |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 115 | |
| 116 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 117 | LOCAL_STATIC_LIBRARIES += libsuspend |
| 118 | endif |
| 119 | |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 120 | LOCAL_HAL_STATIC_LIBRARIES := libhealthd |
Todd Poynor | 10b235e | 2013-08-07 15:25:14 -0700 | [diff] [blame] | 121 | |
Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 122 | # Symlink /charger to /sbin/healthd |
| 123 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \ |
| 124 | && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger |
| 125 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 126 | include $(BUILD_EXECUTABLE) |
| 127 | |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 128 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 129 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 130 | define _add-charger-image |
| 131 | include $$(CLEAR_VARS) |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 132 | LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1)) |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 133 | LOCAL_MODULE_STEM := $(notdir $(1)) |
| 134 | _img_modules += $$(LOCAL_MODULE) |
| 135 | LOCAL_SRC_FILES := $1 |
| 136 | LOCAL_MODULE_TAGS := optional |
| 137 | LOCAL_MODULE_CLASS := ETC |
| 138 | LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger |
| 139 | include $$(BUILD_PREBUILT) |
| 140 | endef |
| 141 | |
| 142 | _img_modules := |
| 143 | _images := |
| 144 | $(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \ |
| 145 | $(eval $(call _add-charger-image,$(_img)))) |
| 146 | |
| 147 | include $(CLEAR_VARS) |
| 148 | LOCAL_MODULE := charger_res_images |
| 149 | LOCAL_MODULE_TAGS := optional |
| 150 | LOCAL_REQUIRED_MODULES := $(_img_modules) |
| 151 | include $(BUILD_PHONY_PACKAGE) |
| 152 | |
| 153 | _add-charger-image := |
| 154 | _img_modules := |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 155 | endif # LOCAL_CHARGER_NO_UI |