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