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) |
| 6 | LOCAL_SRC_FILES := healthd_board_default.cpp |
| 7 | LOCAL_MODULE := libhealthd.default |
Mark Salyzyn | 6f5b47f | 2014-05-15 15:00:59 -0700 | [diff] [blame] | 8 | LOCAL_CFLAGS := -Werror |
Yabin Cui | e98e177 | 2016-02-17 12:21:34 -0800 | [diff] [blame] | 9 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 10 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Christopher Wiley | 2239908 | 2016-04-12 09:21:51 -0700 | [diff] [blame] | 11 | LOCAL_STATIC_LIBRARIES := libbinder |
Christopher Wiley | 8ac71c7 | 2016-04-18 09:33:53 -0700 | [diff] [blame] | 12 | LOCAL_EXPORT_STATIC_LIBRARY_HEADERS := libbinder |
Yabin Cui | e98e177 | 2016-02-17 12:21:34 -0800 | [diff] [blame] | 13 | include $(BUILD_STATIC_LIBRARY) |
| 14 | |
| 15 | include $(CLEAR_VARS) |
| 16 | LOCAL_SRC_FILES := BatteryMonitor.cpp |
| 17 | LOCAL_MODULE := libbatterymonitor |
| 18 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 19 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Michael Scott | 3217c5c | 2016-06-05 11:20:13 -0700 | [diff] [blame] | 20 | LOCAL_STATIC_LIBRARIES := libutils libbase libbinder |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 21 | include $(BUILD_STATIC_LIBRARY) |
| 22 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 23 | include $(CLEAR_VARS) |
Nick Vaccaro | e3083de | 2016-10-24 13:35:47 -0700 | [diff] [blame] | 24 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 25 | LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND |
| 26 | LOCAL_SHARED_LIBRARIES += libsuspend |
| 27 | endif |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 28 | LOCAL_SRC_FILES := \ |
| 29 | healthd_mode_android.cpp \ |
| 30 | healthd_mode_charger.cpp \ |
| 31 | AnimationParser.cpp \ |
| 32 | BatteryPropertiesRegistrar.cpp \ |
| 33 | |
| 34 | LOCAL_MODULE := libhealthd_internal |
| 35 | LOCAL_C_INCLUDES := bootable/recovery |
| 36 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ |
| 37 | $(LOCAL_PATH) \ |
| 38 | $(LOCAL_PATH)/include \ |
| 39 | |
| 40 | LOCAL_STATIC_LIBRARIES := \ |
| 41 | libbatterymonitor \ |
| 42 | libbatteryservice \ |
| 43 | libbinder \ |
| 44 | libminui \ |
| 45 | libpng \ |
| 46 | libz \ |
| 47 | libutils \ |
| 48 | libbase \ |
| 49 | libcutils \ |
| 50 | liblog \ |
| 51 | libm \ |
| 52 | libc \ |
| 53 | |
| 54 | include $(BUILD_STATIC_LIBRARY) |
| 55 | |
| 56 | |
| 57 | include $(CLEAR_VARS) |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 58 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 59 | ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true) |
| 60 | LOCAL_CHARGER_NO_UI := true |
| 61 | endif |
| 62 | ifdef BRILLO |
| 63 | LOCAL_CHARGER_NO_UI := true |
| 64 | endif |
| 65 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 66 | LOCAL_SRC_FILES := \ |
| 67 | healthd.cpp \ |
Todd Poynor | c7464c9 | 2013-09-10 12:40:00 -0700 | [diff] [blame] | 68 | healthd_mode_android.cpp \ |
Damien Bargiacchi | afd59e2 | 2016-09-13 08:37:37 -0700 | [diff] [blame] | 69 | BatteryPropertiesRegistrar.cpp \ |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 70 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 71 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
| 72 | LOCAL_SRC_FILES += healthd_mode_charger.cpp |
| 73 | endif |
| 74 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 75 | LOCAL_MODULE := healthd |
| 76 | LOCAL_MODULE_TAGS := optional |
| 77 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 78 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) |
| 79 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) |
| 80 | |
Mark Salyzyn | 6f5b47f | 2014-05-15 15:00:59 -0700 | [diff] [blame] | 81 | LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 82 | |
| 83 | ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true) |
| 84 | LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK |
| 85 | endif |
| 86 | |
| 87 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 88 | LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND |
| 89 | endif |
| 90 | |
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 |
| 94 | |
Yabin Cui | e98e177 | 2016-02-17 12:21:34 -0800 | [diff] [blame] | 95 | LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 96 | |
Nick Vaccaro | 1f1a6fd | 2016-10-21 19:16:40 -0700 | [diff] [blame] | 97 | ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),) |
| 98 | LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST) |
| 99 | endif |
| 100 | |
| 101 | ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),) |
| 102 | LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW) |
| 103 | endif |
| 104 | |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 105 | LOCAL_STATIC_LIBRARIES := \ |
| 106 | libhealthd_internal \ |
| 107 | libbatterymonitor \ |
| 108 | libbatteryservice \ |
| 109 | libbinder \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 110 | libbase \ |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 111 | |
| 112 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
Damien Bargiacchi | afd59e2 | 2016-09-13 08:37:37 -0700 | [diff] [blame] | 113 | LOCAL_STATIC_LIBRARIES += \ |
| 114 | libminui \ |
| 115 | libpng \ |
| 116 | libz \ |
| 117 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 118 | endif |
| 119 | |
Damien Bargiacchi | afd59e2 | 2016-09-13 08:37:37 -0700 | [diff] [blame] | 120 | |
| 121 | LOCAL_STATIC_LIBRARIES += \ |
| 122 | libutils \ |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 123 | libcutils \ |
| 124 | liblog \ |
| 125 | libm \ |
Damien Bargiacchi | afd59e2 | 2016-09-13 08:37:37 -0700 | [diff] [blame] | 126 | libc \ |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 127 | |
| 128 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 129 | LOCAL_STATIC_LIBRARIES += libsuspend |
| 130 | endif |
| 131 | |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 132 | LOCAL_HAL_STATIC_LIBRARIES := libhealthd |
Todd Poynor | 10b235e | 2013-08-07 15:25:14 -0700 | [diff] [blame] | 133 | |
Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 134 | # Symlink /charger to /sbin/healthd |
| 135 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \ |
| 136 | && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger |
| 137 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 138 | include $(BUILD_EXECUTABLE) |
| 139 | |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 140 | |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 141 | ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 142 | define _add-charger-image |
| 143 | include $$(CLEAR_VARS) |
Damien Bargiacchi | 565ba02 | 2016-08-11 15:29:50 -0700 | [diff] [blame] | 144 | LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1)) |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 145 | LOCAL_MODULE_STEM := $(notdir $(1)) |
| 146 | _img_modules += $$(LOCAL_MODULE) |
| 147 | LOCAL_SRC_FILES := $1 |
| 148 | LOCAL_MODULE_TAGS := optional |
| 149 | LOCAL_MODULE_CLASS := ETC |
| 150 | LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger |
| 151 | include $$(BUILD_PREBUILT) |
| 152 | endef |
| 153 | |
| 154 | _img_modules := |
| 155 | _images := |
| 156 | $(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \ |
| 157 | $(eval $(call _add-charger-image,$(_img)))) |
| 158 | |
| 159 | include $(CLEAR_VARS) |
| 160 | LOCAL_MODULE := charger_res_images |
| 161 | LOCAL_MODULE_TAGS := optional |
| 162 | LOCAL_REQUIRED_MODULES := $(_img_modules) |
| 163 | include $(BUILD_PHONY_PACKAGE) |
| 164 | |
| 165 | _add-charger-image := |
| 166 | _img_modules := |
Todd Poynor | 7c5a3e1 | 2016-02-12 19:53:15 -0800 | [diff] [blame] | 167 | endif # LOCAL_CHARGER_NO_UI |