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 | |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 5 | ### libhealthd_draw ### |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 6 | include $(CLEAR_VARS) |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 7 | |
Luke Song | 1d540dd | 2017-07-13 15:10:35 -0700 | [diff] [blame] | 8 | LOCAL_MODULE := libhealthd_draw |
| 9 | |
| 10 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 11 | LOCAL_STATIC_LIBRARIES := libminui |
| 12 | LOCAL_SHARED_LIBRARIES := libbase |
Luke Song | 1d540dd | 2017-07-13 15:10:35 -0700 | [diff] [blame] | 13 | LOCAL_SRC_FILES := healthd_draw.cpp |
| 14 | |
| 15 | ifneq ($(TARGET_HEALTHD_DRAW_SPLIT_SCREEN),) |
| 16 | LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_SCREEN=$(TARGET_HEALTHD_DRAW_SPLIT_SCREEN) |
| 17 | else |
| 18 | LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_SCREEN=0 |
| 19 | endif |
| 20 | |
| 21 | ifneq ($(TARGET_HEALTHD_DRAW_SPLIT_OFFSET),) |
| 22 | LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_OFFSET=$(TARGET_HEALTHD_DRAW_SPLIT_OFFSET) |
| 23 | else |
| 24 | LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_OFFSET=0 |
| 25 | endif |
| 26 | |
Yifan Hong | 9a81d54 | 2018-05-04 13:53:41 -0700 | [diff] [blame] | 27 | LOCAL_HEADER_LIBRARIES := libbatteryservice_headers |
| 28 | |
Luke Song | 1d540dd | 2017-07-13 15:10:35 -0700 | [diff] [blame] | 29 | include $(BUILD_STATIC_LIBRARY) |
| 30 | |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 31 | ### libhealthd_charger ### |
Luke Song | 1d540dd | 2017-07-13 15:10:35 -0700 | [diff] [blame] | 32 | include $(CLEAR_VARS) |
| 33 | |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 34 | LOCAL_CFLAGS := -Werror |
| 35 | ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true) |
| 36 | LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK |
| 37 | endif |
| 38 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 39 | LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND |
| 40 | endif |
| 41 | |
| 42 | LOCAL_SRC_FILES := \ |
| 43 | healthd_mode_charger.cpp \ |
| 44 | AnimationParser.cpp |
| 45 | |
| 46 | LOCAL_MODULE := libhealthd_charger |
Tao Bao | b6ccc78 | 2018-09-06 15:13:47 -0700 | [diff] [blame] | 47 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 48 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ |
| 49 | $(LOCAL_PATH) \ |
| 50 | $(LOCAL_PATH)/include |
| 51 | |
| 52 | LOCAL_STATIC_LIBRARIES := \ |
Hridya Valsaraju | ffb1303 | 2017-12-11 17:32:22 -0800 | [diff] [blame] | 53 | android.hardware.health@2.0-impl \ |
Hridya Valsaraju | 7fa7225 | 2018-01-12 17:44:33 -0800 | [diff] [blame] | 54 | android.hardware.health@1.0-convert \ |
Hridya Valsaraju | 89178e7 | 2018-01-10 16:14:28 -0800 | [diff] [blame] | 55 | libhealthstoragedefault \ |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 56 | libhealthd_draw \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 57 | libminui \ |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 58 | |
| 59 | LOCAL_SHARED_LIBRARIES := \ |
| 60 | android.hardware.health@2.0 \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 61 | libbase \ |
| 62 | libcutils \ |
| 63 | liblog \ |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 64 | libpng \ |
| 65 | libutils \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 66 | |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 67 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 68 | LOCAL_SHARED_LIBRARIES += libsuspend |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 69 | endif |
| 70 | |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 71 | include $(BUILD_STATIC_LIBRARY) |
| 72 | |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 73 | ### charger ### |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 74 | include $(CLEAR_VARS) |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 75 | ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true) |
| 76 | LOCAL_CHARGER_NO_UI := true |
| 77 | endif |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 78 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 79 | LOCAL_SRC_FILES := \ |
Sandeep Patil | 526f8cf | 2016-11-01 16:41:56 -0700 | [diff] [blame] | 80 | charger.cpp \ |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 81 | |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 82 | LOCAL_MODULE := charger |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 83 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 84 | |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 85 | LOCAL_CFLAGS := -Werror |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 86 | ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
| 87 | LOCAL_CFLAGS += -DCHARGER_NO_UI |
| 88 | endif |
Nick Vaccaro | 1f1a6fd | 2016-10-21 19:16:40 -0700 | [diff] [blame] | 89 | |
Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 90 | CHARGER_STATIC_LIBRARIES := \ |
Yifan Hong | 10c2b40 | 2017-11-08 10:57:52 -0800 | [diff] [blame] | 91 | android.hardware.health@2.0-impl \ |
Hridya Valsaraju | 7fa7225 | 2018-01-12 17:44:33 -0800 | [diff] [blame] | 92 | android.hardware.health@1.0-convert \ |
Jayant Chowdhary | c2d3949 | 2018-10-01 22:50:07 +0000 | [diff] [blame] | 93 | libbinderthreadstate \ |
Yifan Hong | 10c2b40 | 2017-11-08 10:57:52 -0800 | [diff] [blame] | 94 | libhidltransport \ |
| 95 | libhidlbase \ |
Pirama Arumuga Nainar | 9dddfbc | 2018-04-09 10:40:06 -0700 | [diff] [blame] | 96 | libhwbinder_noltopgo \ |
Hridya Valsaraju | 89178e7 | 2018-01-10 16:14:28 -0800 | [diff] [blame] | 97 | libhealthstoragedefault \ |
Yifan Hong | 10c2b40 | 2017-11-08 10:57:52 -0800 | [diff] [blame] | 98 | libvndksupport \ |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 99 | libhealthd_charger \ |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 100 | libhealthd_charger_nops \ |
Luke Song | 1d540dd | 2017-07-13 15:10:35 -0700 | [diff] [blame] | 101 | libhealthd_draw \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 102 | libbatterymonitor \ |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 103 | |
| 104 | CHARGER_SHARED_LIBRARIES := \ |
| 105 | android.hardware.health@2.0 \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 106 | libbase \ |
| 107 | libcutils \ |
Suren Baghdasaryan | 82b72a5 | 2018-12-21 11:41:50 -0800 | [diff] [blame] | 108 | libjsoncpp \ |
Suren Baghdasaryan | 9491078 | 2019-01-25 05:32:52 +0000 | [diff] [blame] | 109 | libprocessgroup \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 110 | liblog \ |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 111 | libutils \ |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 112 | |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 113 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 114 | CHARGER_STATIC_LIBRARIES += libminui |
| 115 | CHARGER_SHARED_LIBRARIES += libpng |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 116 | endif |
| 117 | |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 118 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 119 | CHARGER_SHARED_LIBRARIES += libsuspend |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 120 | endif |
| 121 | |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 122 | LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES) |
| 123 | LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES) |
| 124 | |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 125 | LOCAL_HAL_STATIC_LIBRARIES := libhealthd |
Todd Poynor | 10b235e | 2013-08-07 15:25:14 -0700 | [diff] [blame] | 126 | |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 127 | # Symlink /charger to /system/bin/charger |
Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 128 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \ |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 129 | && ln -sf /system/bin/charger $(TARGET_ROOT_OUT)/charger |
Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 130 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 131 | include $(BUILD_EXECUTABLE) |
| 132 | |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 133 | ### charger.recovery ### |
| 134 | include $(CLEAR_VARS) |
| 135 | |
| 136 | LOCAL_SRC_FILES := \ |
| 137 | charger.cpp \ |
| 138 | |
| 139 | LOCAL_MODULE := charger.recovery |
| 140 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin |
| 141 | LOCAL_MODULE_STEM := charger |
| 142 | |
| 143 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 144 | LOCAL_CFLAGS := -Wall -Werror |
| 145 | LOCAL_CFLAGS += -DCHARGER_NO_UI |
| 146 | |
| 147 | # charger.recovery doesn't link against libhealthd_{charger,draw} or libminui, since it doesn't need |
| 148 | # any UI support. |
| 149 | LOCAL_STATIC_LIBRARIES := \ |
| 150 | android.hardware.health@2.0-impl \ |
| 151 | android.hardware.health@1.0-convert \ |
| 152 | libbinderthreadstate \ |
| 153 | libhidltransport \ |
| 154 | libhidlbase \ |
| 155 | libhwbinder_noltopgo \ |
| 156 | libhealthstoragedefault \ |
| 157 | libvndksupport \ |
| 158 | libhealthd_charger_nops \ |
| 159 | libbatterymonitor \ |
| 160 | |
| 161 | # These shared libs will be installed to recovery image because of the dependency in `recovery` |
| 162 | # module. |
| 163 | LOCAL_SHARED_LIBRARIES := \ |
| 164 | android.hardware.health@2.0 \ |
| 165 | libbase \ |
| 166 | libcutils \ |
| 167 | liblog \ |
| 168 | libutils \ |
| 169 | |
| 170 | # The use of LOCAL_HAL_STATIC_LIBRARIES prevents from building this module with Android.bp. |
| 171 | LOCAL_HAL_STATIC_LIBRARIES := libhealthd |
| 172 | |
| 173 | include $(BUILD_EXECUTABLE) |
| 174 | |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 175 | ### charger_test ### |
Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 176 | include $(CLEAR_VARS) |
| 177 | LOCAL_MODULE := charger_test |
Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 178 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 179 | LOCAL_CFLAGS := -Wall -Werror -DCHARGER_NO_UI |
Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 180 | LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES) |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 181 | LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES) |
Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 182 | LOCAL_SRC_FILES := \ |
Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 183 | charger_test.cpp \ |
| 184 | |
| 185 | include $(BUILD_EXECUTABLE) |
| 186 | |
| 187 | CHARGER_STATIC_LIBRARIES := |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 188 | CHARGER_SHARED_LIBRARIES := |
Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 189 | |
Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 190 | ### charger_res_images ### |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 191 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 192 | define _add-charger-image |
| 193 | include $$(CLEAR_VARS) |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 194 | LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1)) |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 195 | LOCAL_MODULE_STEM := $(notdir $(1)) |
| 196 | _img_modules += $$(LOCAL_MODULE) |
| 197 | LOCAL_SRC_FILES := $1 |
| 198 | LOCAL_MODULE_TAGS := optional |
| 199 | LOCAL_MODULE_CLASS := ETC |
| 200 | LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger |
| 201 | include $$(BUILD_PREBUILT) |
| 202 | endef |
| 203 | |
| 204 | _img_modules := |
| 205 | _images := |
| 206 | $(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \ |
| 207 | $(eval $(call _add-charger-image,$(_img)))) |
| 208 | |
| 209 | include $(CLEAR_VARS) |
| 210 | LOCAL_MODULE := charger_res_images |
| 211 | LOCAL_MODULE_TAGS := optional |
| 212 | LOCAL_REQUIRED_MODULES := $(_img_modules) |
| 213 | include $(BUILD_PHONY_PACKAGE) |
| 214 | |
| 215 | _add-charger-image := |
| 216 | _img_modules := |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 217 | endif # LOCAL_CHARGER_NO_UI |