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