| 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 |  | 
| Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 5 | ### charger ### | 
| Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 6 | include $(CLEAR_VARS) | 
| Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 7 | ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true) | 
 | 8 | LOCAL_CHARGER_NO_UI := true | 
 | 9 | endif | 
| Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 10 |  | 
| Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 11 | LOCAL_SRC_FILES := \ | 
| Sandeep Patil | 526f8cf | 2016-11-01 16:41:56 -0700 | [diff] [blame] | 12 |     charger.cpp \ | 
| Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 13 |  | 
| Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 14 | LOCAL_MODULE := charger | 
| Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 15 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include | 
| Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 16 |  | 
| Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 17 | LOCAL_CFLAGS := -Werror | 
| Nick Vaccaro | 1f1a6fd | 2016-10-21 19:16:40 -0700 | [diff] [blame] | 18 |  | 
| Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 19 | CHARGER_STATIC_LIBRARIES := \ | 
| Yifan Hong | 10c2b40 | 2017-11-08 10:57:52 -0800 | [diff] [blame] | 20 |     android.hardware.health@2.0-impl \ | 
| Hridya Valsaraju | 7fa7225 | 2018-01-12 17:44:33 -0800 | [diff] [blame] | 21 |     android.hardware.health@1.0-convert \ | 
| Jayant Chowdhary | c2d3949 | 2018-10-01 22:50:07 +0000 | [diff] [blame] | 22 |     libbinderthreadstate \ | 
| Yifan Hong | 97eecdc | 2019-07-03 11:07:37 -0700 | [diff] [blame] | 23 |     libcharger_sysprop \ | 
| Yifan Hong | 10c2b40 | 2017-11-08 10:57:52 -0800 | [diff] [blame] | 24 |     libhidlbase \ | 
| Hridya Valsaraju | 89178e7 | 2018-01-10 16:14:28 -0800 | [diff] [blame] | 25 |     libhealthstoragedefault \ | 
| Yifan Hong | dbaa477 | 2019-07-03 11:40:08 -0700 | [diff] [blame] | 26 |     libminui \ | 
| Yifan Hong | 10c2b40 | 2017-11-08 10:57:52 -0800 | [diff] [blame] | 27 |     libvndksupport \ | 
| Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 28 |     libhealthd_charger \ | 
| Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 29 |     libhealthd_charger_nops \ | 
| Luke Song | 1d540dd | 2017-07-13 15:10:35 -0700 | [diff] [blame] | 30 |     libhealthd_draw \ | 
| Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 31 |     libbatterymonitor \ | 
| Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 32 |  | 
 | 33 | CHARGER_SHARED_LIBRARIES := \ | 
 | 34 |     android.hardware.health@2.0 \ | 
| Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 35 |     libbase \ | 
 | 36 |     libcutils \ | 
| Suren Baghdasaryan | 82b72a5 | 2018-12-21 11:41:50 -0800 | [diff] [blame] | 37 |     libjsoncpp \ | 
| Yifan Hong | dbaa477 | 2019-07-03 11:40:08 -0700 | [diff] [blame] | 38 |     libpng \ | 
| Suren Baghdasaryan | 9491078 | 2019-01-25 05:32:52 +0000 | [diff] [blame] | 39 |     libprocessgroup \ | 
| Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 40 |     liblog \ | 
| Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 41 |     libutils \ | 
| Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 42 |  | 
| Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 43 | CHARGER_SHARED_LIBRARIES += libsuspend | 
| Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 44 |  | 
| Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 45 | LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES) | 
 | 46 | LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES) | 
 | 47 |  | 
| Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 48 | LOCAL_HAL_STATIC_LIBRARIES := libhealthd | 
| Todd Poynor | 10b235e | 2013-08-07 15:25:14 -0700 | [diff] [blame] | 49 |  | 
| Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 50 | # Symlink /charger to /system/bin/charger | 
| Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 51 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \ | 
| Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 52 |     && ln -sf /system/bin/charger $(TARGET_ROOT_OUT)/charger | 
| Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 53 |  | 
| Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 54 | include $(BUILD_EXECUTABLE) | 
 | 55 |  | 
| Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 56 | ### charger.recovery ### | 
 | 57 | include $(CLEAR_VARS) | 
 | 58 |  | 
 | 59 | LOCAL_SRC_FILES := \ | 
 | 60 |     charger.cpp \ | 
 | 61 |  | 
 | 62 | LOCAL_MODULE := charger.recovery | 
 | 63 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin | 
 | 64 | LOCAL_MODULE_STEM := charger | 
 | 65 |  | 
 | 66 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include | 
| Yifan Hong | 97eecdc | 2019-07-03 11:07:37 -0700 | [diff] [blame] | 67 | LOCAL_CFLAGS := -Wall -Werror -DCHARGER_FORCE_NO_UI=1 | 
| Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 68 |  | 
 | 69 | # charger.recovery doesn't link against libhealthd_{charger,draw} or libminui, since it doesn't need | 
 | 70 | # any UI support. | 
 | 71 | LOCAL_STATIC_LIBRARIES := \ | 
 | 72 |     android.hardware.health@2.0-impl \ | 
 | 73 |     android.hardware.health@1.0-convert \ | 
 | 74 |     libbinderthreadstate \ | 
| Yifan Hong | 97eecdc | 2019-07-03 11:07:37 -0700 | [diff] [blame] | 75 |     libcharger_sysprop \ | 
| Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 76 |     libhidlbase \ | 
| Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 77 |     libhealthstoragedefault \ | 
 | 78 |     libvndksupport \ | 
 | 79 |     libhealthd_charger_nops \ | 
 | 80 |     libbatterymonitor \ | 
 | 81 |  | 
 | 82 | # These shared libs will be installed to recovery image because of the dependency in `recovery` | 
 | 83 | # module. | 
 | 84 | LOCAL_SHARED_LIBRARIES := \ | 
 | 85 |     android.hardware.health@2.0 \ | 
 | 86 |     libbase \ | 
 | 87 |     libcutils \ | 
 | 88 |     liblog \ | 
 | 89 |     libutils \ | 
 | 90 |  | 
 | 91 | # The use of LOCAL_HAL_STATIC_LIBRARIES prevents from building this module with Android.bp. | 
 | 92 | LOCAL_HAL_STATIC_LIBRARIES := libhealthd | 
 | 93 |  | 
 | 94 | include $(BUILD_EXECUTABLE) | 
 | 95 |  | 
| Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 96 | ### charger_test ### | 
| Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 97 | include $(CLEAR_VARS) | 
 | 98 | LOCAL_MODULE := charger_test | 
| Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 99 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include | 
| Yifan Hong | 97eecdc | 2019-07-03 11:07:37 -0700 | [diff] [blame] | 100 | LOCAL_CFLAGS := -Wall -Werror | 
| Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 101 | LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES) | 
| Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 102 | LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES) | 
| Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 103 | LOCAL_SRC_FILES := \ | 
| Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 104 |     charger_test.cpp \ | 
 | 105 |  | 
 | 106 | include $(BUILD_EXECUTABLE) | 
 | 107 |  | 
 | 108 | CHARGER_STATIC_LIBRARIES := | 
| Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 109 | CHARGER_SHARED_LIBRARIES := | 
| Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 110 |  | 
| Tao Bao | f2455d8 | 2018-09-07 12:52:46 -0700 | [diff] [blame] | 111 | ### charger_res_images ### | 
| Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 112 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) | 
| Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 113 | define _add-charger-image | 
 | 114 | include $$(CLEAR_VARS) | 
| Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 115 | LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1)) | 
| Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 116 | LOCAL_MODULE_STEM := $(notdir $(1)) | 
 | 117 | _img_modules += $$(LOCAL_MODULE) | 
 | 118 | LOCAL_SRC_FILES := $1 | 
 | 119 | LOCAL_MODULE_TAGS := optional | 
 | 120 | LOCAL_MODULE_CLASS := ETC | 
 | 121 | LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger | 
 | 122 | include $$(BUILD_PREBUILT) | 
 | 123 | endef | 
 | 124 |  | 
 | 125 | _img_modules := | 
 | 126 | _images := | 
 | 127 | $(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \ | 
 | 128 |   $(eval $(call _add-charger-image,$(_img)))) | 
 | 129 |  | 
 | 130 | include $(CLEAR_VARS) | 
 | 131 | LOCAL_MODULE := charger_res_images | 
 | 132 | LOCAL_MODULE_TAGS := optional | 
 | 133 | LOCAL_REQUIRED_MODULES := $(_img_modules) | 
 | 134 | include $(BUILD_PHONY_PACKAGE) | 
 | 135 |  | 
 | 136 | _add-charger-image := | 
 | 137 | _img_modules := | 
| Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 138 | endif # LOCAL_CHARGER_NO_UI |