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