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) |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 6 | |
Luke Song | 1d540dd | 2017-07-13 15:10:35 -0700 | [diff] [blame] | 7 | LOCAL_MODULE := libhealthd_draw |
| 8 | |
| 9 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) |
| 10 | LOCAL_STATIC_LIBRARIES := \ |
| 11 | libminui \ |
| 12 | libbase |
| 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 | |
| 31 | include $(CLEAR_VARS) |
| 32 | |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 33 | LOCAL_CFLAGS := -Werror |
| 34 | ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true) |
| 35 | LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK |
| 36 | endif |
| 37 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 38 | LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND |
| 39 | endif |
| 40 | |
| 41 | LOCAL_SRC_FILES := \ |
| 42 | healthd_mode_charger.cpp \ |
| 43 | AnimationParser.cpp |
| 44 | |
| 45 | LOCAL_MODULE := libhealthd_charger |
Tao Bao | b6ccc78 | 2018-09-06 15:13:47 -0700 | [diff] [blame] | 46 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 47 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ |
| 48 | $(LOCAL_PATH) \ |
| 49 | $(LOCAL_PATH)/include |
| 50 | |
| 51 | LOCAL_STATIC_LIBRARIES := \ |
Yifan Hong | 10c2b40 | 2017-11-08 10:57:52 -0800 | [diff] [blame] | 52 | android.hardware.health@2.0 \ |
Hridya Valsaraju | ffb1303 | 2017-12-11 17:32:22 -0800 | [diff] [blame] | 53 | android.hardware.health@2.0-impl \ |
Yifan Hong | 10c2b40 | 2017-11-08 10:57:52 -0800 | [diff] [blame] | 54 | android.hardware.health@1.0 \ |
Hridya Valsaraju | 7fa7225 | 2018-01-12 17:44:33 -0800 | [diff] [blame] | 55 | android.hardware.health@1.0-convert \ |
Hridya Valsaraju | 89178e7 | 2018-01-10 16:14:28 -0800 | [diff] [blame] | 56 | libhealthstoragedefault \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 57 | libminui \ |
| 58 | libpng \ |
| 59 | libz \ |
| 60 | libutils \ |
| 61 | libbase \ |
| 62 | libcutils \ |
Luke Song | 1d540dd | 2017-07-13 15:10:35 -0700 | [diff] [blame] | 63 | libhealthd_draw \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 64 | liblog \ |
| 65 | libm \ |
| 66 | libc \ |
| 67 | |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 68 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 69 | LOCAL_STATIC_LIBRARIES += libsuspend |
| 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 |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 84 | LOCAL_MODULE_TAGS := optional |
| 85 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 86 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) |
| 87 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 88 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 89 | |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 90 | LOCAL_CFLAGS := -Werror |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 91 | ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
| 92 | LOCAL_CFLAGS += -DCHARGER_NO_UI |
| 93 | endif |
Nick Vaccaro | 1f1a6fd | 2016-10-21 19:16:40 -0700 | [diff] [blame] | 94 | |
Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 95 | CHARGER_STATIC_LIBRARIES := \ |
Yifan Hong | 10c2b40 | 2017-11-08 10:57:52 -0800 | [diff] [blame] | 96 | android.hardware.health@2.0-impl \ |
| 97 | android.hardware.health@2.0 \ |
| 98 | android.hardware.health@1.0 \ |
Hridya Valsaraju | 7fa7225 | 2018-01-12 17:44:33 -0800 | [diff] [blame] | 99 | android.hardware.health@1.0-convert \ |
Yifan Hong | 10c2b40 | 2017-11-08 10:57:52 -0800 | [diff] [blame] | 100 | libhidltransport \ |
| 101 | libhidlbase \ |
Pirama Arumuga Nainar | 9dddfbc | 2018-04-09 10:40:06 -0700 | [diff] [blame] | 102 | libhwbinder_noltopgo \ |
Hridya Valsaraju | 89178e7 | 2018-01-10 16:14:28 -0800 | [diff] [blame] | 103 | libhealthstoragedefault \ |
Yifan Hong | 10c2b40 | 2017-11-08 10:57:52 -0800 | [diff] [blame] | 104 | libvndksupport \ |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 105 | libhealthd_charger \ |
Luke Song | 1d540dd | 2017-07-13 15:10:35 -0700 | [diff] [blame] | 106 | libhealthd_draw \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 107 | libbatterymonitor \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 108 | libbase \ |
Damien Bargiacchi | afd59e2 | 2016-09-13 08:37:37 -0700 | [diff] [blame] | 109 | libutils \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 110 | libcutils \ |
| 111 | liblog \ |
| 112 | libm \ |
Damien Bargiacchi | afd59e2 | 2016-09-13 08:37:37 -0700 | [diff] [blame] | 113 | libc \ |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 114 | |
Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 115 | LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES) |
| 116 | |
Sandeep Patil | fca8244 | 2016-11-01 08:29:30 -0700 | [diff] [blame] | 117 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
| 118 | LOCAL_STATIC_LIBRARIES += \ |
| 119 | libminui \ |
| 120 | libpng \ |
| 121 | libz \ |
| 122 | |
| 123 | endif |
| 124 | |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 125 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 126 | LOCAL_STATIC_LIBRARIES += libsuspend |
| 127 | endif |
| 128 | |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 129 | LOCAL_HAL_STATIC_LIBRARIES := libhealthd |
Todd Poynor | 10b235e | 2013-08-07 15:25:14 -0700 | [diff] [blame] | 130 | |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 131 | # Symlink /charger to /sbin/charger |
Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 132 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \ |
Sandeep Patil | 6012db5 | 2016-11-01 08:45:19 -0700 | [diff] [blame] | 133 | && ln -sf /sbin/charger $(TARGET_ROOT_OUT)/charger |
Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 134 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 135 | include $(BUILD_EXECUTABLE) |
| 136 | |
Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 137 | include $(CLEAR_VARS) |
| 138 | LOCAL_MODULE := charger_test |
| 139 | LOCAL_MODULE_TAGS := optional |
| 140 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 141 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 142 | LOCAL_CFLAGS := -Wall -Werror -DCHARGER_TEST -DCHARGER_NO_UI |
| 143 | LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES) |
| 144 | LOCAL_SRC_FILES := \ |
| 145 | charger.cpp \ |
| 146 | charger_test.cpp \ |
| 147 | |
| 148 | include $(BUILD_EXECUTABLE) |
| 149 | |
| 150 | CHARGER_STATIC_LIBRARIES := |
| 151 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 152 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 153 | define _add-charger-image |
| 154 | include $$(CLEAR_VARS) |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 155 | LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1)) |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 156 | LOCAL_MODULE_STEM := $(notdir $(1)) |
| 157 | _img_modules += $$(LOCAL_MODULE) |
| 158 | LOCAL_SRC_FILES := $1 |
| 159 | LOCAL_MODULE_TAGS := optional |
| 160 | LOCAL_MODULE_CLASS := ETC |
| 161 | LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger |
| 162 | include $$(BUILD_PREBUILT) |
| 163 | endef |
| 164 | |
| 165 | _img_modules := |
| 166 | _images := |
| 167 | $(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \ |
| 168 | $(eval $(call _add-charger-image,$(_img)))) |
| 169 | |
| 170 | include $(CLEAR_VARS) |
| 171 | LOCAL_MODULE := charger_res_images |
| 172 | LOCAL_MODULE_TAGS := optional |
| 173 | LOCAL_REQUIRED_MODULES := $(_img_modules) |
| 174 | include $(BUILD_PHONY_PACKAGE) |
| 175 | |
| 176 | _add-charger-image := |
| 177 | _img_modules := |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 178 | endif # LOCAL_CHARGER_NO_UI |