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) |
Yabin Cui | e98e177 | 2016-02-17 12:21:34 -0800 | [diff] [blame] | 6 | LOCAL_SRC_FILES := BatteryMonitor.cpp |
| 7 | LOCAL_MODULE := libbatterymonitor |
| 8 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 9 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Michael Scott | 3217c5c | 2016-06-05 11:20:13 -0700 | [diff] [blame] | 10 | LOCAL_STATIC_LIBRARIES := libutils libbase libbinder |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 11 | include $(BUILD_STATIC_LIBRARY) |
| 12 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 13 | include $(CLEAR_VARS) |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 14 | LOCAL_SRC_FILES := \ |
| 15 | healthd_mode_android.cpp \ |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 16 | BatteryPropertiesRegistrar.cpp |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 17 | |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 18 | LOCAL_MODULE := libhealthd_android |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 19 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ |
| 20 | $(LOCAL_PATH) \ |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 21 | $(LOCAL_PATH)/include |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 22 | |
| 23 | LOCAL_STATIC_LIBRARIES := \ |
| 24 | libbatterymonitor \ |
| 25 | libbatteryservice \ |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 26 | libutils \ |
| 27 | libbase \ |
| 28 | libcutils \ |
| 29 | liblog \ |
| 30 | libc \ |
| 31 | |
| 32 | include $(BUILD_STATIC_LIBRARY) |
| 33 | |
| 34 | include $(CLEAR_VARS) |
| 35 | |
| 36 | LOCAL_CFLAGS := -Werror |
| 37 | ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true) |
| 38 | LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK |
| 39 | endif |
| 40 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 41 | LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND |
| 42 | endif |
| 43 | |
| 44 | LOCAL_SRC_FILES := \ |
| 45 | healthd_mode_charger.cpp \ |
| 46 | AnimationParser.cpp |
| 47 | |
| 48 | LOCAL_MODULE := libhealthd_charger |
| 49 | LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include |
| 50 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ |
| 51 | $(LOCAL_PATH) \ |
| 52 | $(LOCAL_PATH)/include |
| 53 | |
| 54 | LOCAL_STATIC_LIBRARIES := \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 55 | libminui \ |
| 56 | libpng \ |
| 57 | libz \ |
| 58 | libutils \ |
| 59 | libbase \ |
| 60 | libcutils \ |
| 61 | liblog \ |
| 62 | libm \ |
| 63 | libc \ |
| 64 | |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 65 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 66 | LOCAL_STATIC_LIBRARIES += libsuspend |
| 67 | endif |
| 68 | |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 69 | include $(BUILD_STATIC_LIBRARY) |
| 70 | |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 71 | ### charger ### |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 72 | include $(CLEAR_VARS) |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 73 | ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true) |
| 74 | LOCAL_CHARGER_NO_UI := true |
| 75 | endif |
| 76 | ifdef BRILLO |
| 77 | LOCAL_CHARGER_NO_UI := true |
| 78 | endif |
| 79 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 80 | LOCAL_SRC_FILES := \ |
Sandeep Patil | 526f8cf | 2016-11-01 16:41:56 -0700 | [diff] [blame] | 81 | healthd_common.cpp \ |
| 82 | charger.cpp \ |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 83 | |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 84 | LOCAL_MODULE := charger |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 85 | LOCAL_MODULE_TAGS := optional |
| 86 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 87 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) |
| 88 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 89 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 90 | |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 91 | LOCAL_CFLAGS := -Werror |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 92 | ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
| 93 | LOCAL_CFLAGS += -DCHARGER_NO_UI |
| 94 | endif |
Nick Vaccaro | 1f1a6fd | 2016-10-21 19:16:40 -0700 | [diff] [blame] | 95 | ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),) |
| 96 | LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST) |
| 97 | endif |
Nick Vaccaro | 1f1a6fd | 2016-10-21 19:16:40 -0700 | [diff] [blame] | 98 | ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),) |
| 99 | LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW) |
| 100 | endif |
| 101 | |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 102 | LOCAL_STATIC_LIBRARIES := \ |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 103 | libhealthd_charger \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 104 | libbatterymonitor \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 105 | libbase \ |
Damien Bargiacchi | afd59e2 | 2016-09-13 08:37:37 -0700 | [diff] [blame] | 106 | libutils \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 107 | libcutils \ |
| 108 | liblog \ |
| 109 | libm \ |
Damien Bargiacchi | afd59e2 | 2016-09-13 08:37:37 -0700 | [diff] [blame] | 110 | libc \ |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 111 | |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 112 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
| 113 | LOCAL_STATIC_LIBRARIES += \ |
| 114 | libminui \ |
| 115 | libpng \ |
| 116 | libz \ |
| 117 | |
| 118 | endif |
| 119 | |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 120 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 121 | LOCAL_STATIC_LIBRARIES += libsuspend |
| 122 | endif |
| 123 | |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 124 | LOCAL_HAL_STATIC_LIBRARIES := libhealthd |
Todd Poynor | 10b235e | 2013-08-07 15:25:14 -0700 | [diff] [blame] | 125 | |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 126 | # Symlink /charger to /sbin/charger |
Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 127 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \ |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 128 | && ln -sf /sbin/charger $(TARGET_ROOT_OUT)/charger |
Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 129 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 130 | include $(BUILD_EXECUTABLE) |
| 131 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 132 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 133 | define _add-charger-image |
| 134 | include $$(CLEAR_VARS) |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 135 | LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1)) |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 136 | LOCAL_MODULE_STEM := $(notdir $(1)) |
| 137 | _img_modules += $$(LOCAL_MODULE) |
| 138 | LOCAL_SRC_FILES := $1 |
| 139 | LOCAL_MODULE_TAGS := optional |
| 140 | LOCAL_MODULE_CLASS := ETC |
| 141 | LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger |
| 142 | include $$(BUILD_PREBUILT) |
| 143 | endef |
| 144 | |
| 145 | _img_modules := |
| 146 | _images := |
| 147 | $(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \ |
| 148 | $(eval $(call _add-charger-image,$(_img)))) |
| 149 | |
| 150 | include $(CLEAR_VARS) |
| 151 | LOCAL_MODULE := charger_res_images |
| 152 | LOCAL_MODULE_TAGS := optional |
| 153 | LOCAL_REQUIRED_MODULES := $(_img_modules) |
| 154 | include $(BUILD_PHONY_PACKAGE) |
| 155 | |
| 156 | _add-charger-image := |
| 157 | _img_modules := |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 158 | endif # LOCAL_CHARGER_NO_UI |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 159 | |
| 160 | ### healthd ### |
| 161 | include $(CLEAR_VARS) |
| 162 | |
| 163 | LOCAL_SRC_FILES := \ |
Sandeep Patil | 526f8cf | 2016-11-01 16:41:56 -0700 | [diff] [blame] | 164 | healthd_common.cpp \ |
| 165 | healthd.cpp \ |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 166 | |
| 167 | LOCAL_MODULE := healthd |
| 168 | LOCAL_MODULE_TAGS := optional |
| 169 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 170 | |
| 171 | ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),) |
| 172 | LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST) |
| 173 | endif |
| 174 | ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),) |
| 175 | LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW) |
| 176 | endif |
| 177 | |
| 178 | LOCAL_STATIC_LIBRARIES := \ |
| 179 | libhealthd_android \ |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 180 | libbatterymonitor \ |
| 181 | libbatteryservice \ |
Sandeep Patil | a368195 | 2016-11-08 16:27:54 -0800 | [diff] [blame] | 182 | android.hardware.health@1.0-convert \ |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 183 | |
| 184 | LOCAL_SHARED_LIBRARIES := \ |
| 185 | libbinder \ |
| 186 | libbase \ |
| 187 | libutils \ |
| 188 | libcutils \ |
| 189 | liblog \ |
| 190 | libm \ |
| 191 | libc \ |
Yifan Hong | 62e840f | 2016-11-17 13:00:55 -0800 | [diff] [blame] | 192 | libhidlbase \ |
| 193 | libhidltransport \ |
Sandeep Patil | a368195 | 2016-11-08 16:27:54 -0800 | [diff] [blame] | 194 | android.hardware.health@1.0 \ |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 195 | |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 196 | include $(BUILD_EXECUTABLE) |