1# Copyright 2013 The Android Open Source Project 2 3LOCAL_PATH := $(call my-dir) 4 5include $(CLEAR_VARS) 6LOCAL_SRC_FILES := BatteryMonitor.cpp 7LOCAL_MODULE := libbatterymonitor 8LOCAL_C_INCLUDES := $(LOCAL_PATH)/include 9LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include 10LOCAL_STATIC_LIBRARIES := libutils libbase libbinder 11include $(BUILD_STATIC_LIBRARY) 12 13include $(CLEAR_VARS) 14LOCAL_SRC_FILES := \ 15 healthd_mode_android.cpp \ 16 BatteryPropertiesRegistrar.cpp 17 18LOCAL_MODULE := libhealthd_android 19LOCAL_EXPORT_C_INCLUDE_DIRS := \ 20 $(LOCAL_PATH) \ 21 $(LOCAL_PATH)/include 22 23LOCAL_STATIC_LIBRARIES := \ 24 libbatterymonitor \ 25 libbatteryservice \ 26 libutils \ 27 libbase \ 28 libcutils \ 29 liblog \ 30 libc \ 31 32include $(BUILD_STATIC_LIBRARY) 33 34include $(CLEAR_VARS) 35 36LOCAL_MODULE := libhealthd_draw 37 38LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 39LOCAL_STATIC_LIBRARIES := \ 40 libminui \ 41 libbase 42LOCAL_SRC_FILES := healthd_draw.cpp 43 44ifneq ($(TARGET_HEALTHD_DRAW_SPLIT_SCREEN),) 45LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_SCREEN=$(TARGET_HEALTHD_DRAW_SPLIT_SCREEN) 46else 47LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_SCREEN=0 48endif 49 50ifneq ($(TARGET_HEALTHD_DRAW_SPLIT_OFFSET),) 51LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_OFFSET=$(TARGET_HEALTHD_DRAW_SPLIT_OFFSET) 52else 53LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_OFFSET=0 54endif 55 56include $(BUILD_STATIC_LIBRARY) 57 58include $(CLEAR_VARS) 59 60LOCAL_CFLAGS := -Werror 61ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true) 62LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK 63endif 64ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) 65LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND 66endif 67 68LOCAL_SRC_FILES := \ 69 healthd_mode_charger.cpp \ 70 AnimationParser.cpp 71 72LOCAL_MODULE := libhealthd_charger 73LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include 74LOCAL_EXPORT_C_INCLUDE_DIRS := \ 75 $(LOCAL_PATH) \ 76 $(LOCAL_PATH)/include 77 78LOCAL_STATIC_LIBRARIES := \ 79 libminui \ 80 libpng \ 81 libz \ 82 libutils \ 83 libbase \ 84 libcutils \ 85 libhealthd_draw \ 86 liblog \ 87 libm \ 88 libc \ 89 90ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) 91LOCAL_STATIC_LIBRARIES += libsuspend 92endif 93 94include $(BUILD_STATIC_LIBRARY) 95 96### charger ### 97include $(CLEAR_VARS) 98ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true) 99LOCAL_CHARGER_NO_UI := true 100endif 101ifdef BRILLO 102LOCAL_CHARGER_NO_UI := true 103endif 104 105LOCAL_SRC_FILES := \ 106 healthd_common.cpp \ 107 charger.cpp \ 108 109LOCAL_MODULE := charger 110LOCAL_MODULE_TAGS := optional 111LOCAL_FORCE_STATIC_EXECUTABLE := true 112LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) 113LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) 114LOCAL_C_INCLUDES := $(LOCAL_PATH)/include 115 116LOCAL_CFLAGS := -Werror 117ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true) 118LOCAL_CFLAGS += -DCHARGER_NO_UI 119endif 120ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),) 121LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST) 122endif 123ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),) 124LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW) 125endif 126 127LOCAL_STATIC_LIBRARIES := \ 128 libhealthd_charger \ 129 libhealthd_draw \ 130 libbatterymonitor \ 131 libbase \ 132 libutils \ 133 libcutils \ 134 liblog \ 135 libm \ 136 libc \ 137 138ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) 139LOCAL_STATIC_LIBRARIES += \ 140 libminui \ 141 libpng \ 142 libz \ 143 144endif 145 146ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) 147LOCAL_STATIC_LIBRARIES += libsuspend 148endif 149 150LOCAL_HAL_STATIC_LIBRARIES := libhealthd 151 152# Symlink /charger to /sbin/charger 153LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \ 154 && ln -sf /sbin/charger $(TARGET_ROOT_OUT)/charger 155 156include $(BUILD_EXECUTABLE) 157 158ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) 159define _add-charger-image 160include $$(CLEAR_VARS) 161LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1)) 162LOCAL_MODULE_STEM := $(notdir $(1)) 163_img_modules += $$(LOCAL_MODULE) 164LOCAL_SRC_FILES := $1 165LOCAL_MODULE_TAGS := optional 166LOCAL_MODULE_CLASS := ETC 167LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger 168include $$(BUILD_PREBUILT) 169endef 170 171_img_modules := 172_images := 173$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \ 174 $(eval $(call _add-charger-image,$(_img)))) 175 176include $(CLEAR_VARS) 177LOCAL_MODULE := charger_res_images 178LOCAL_MODULE_TAGS := optional 179LOCAL_REQUIRED_MODULES := $(_img_modules) 180include $(BUILD_PHONY_PACKAGE) 181 182_add-charger-image := 183_img_modules := 184endif # LOCAL_CHARGER_NO_UI 185 186### healthd ### 187include $(CLEAR_VARS) 188 189LOCAL_SRC_FILES := \ 190 healthd_common.cpp \ 191 healthd.cpp \ 192 193LOCAL_MODULE := healthd 194LOCAL_MODULE_TAGS := optional 195LOCAL_C_INCLUDES := $(LOCAL_PATH)/include 196 197ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),) 198LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST) 199endif 200ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),) 201LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW) 202endif 203 204LOCAL_STATIC_LIBRARIES := \ 205 libhealthd_android \ 206 libbatterymonitor \ 207 libbatteryservice \ 208 android.hardware.health@1.0-convert \ 209 210LOCAL_SHARED_LIBRARIES := \ 211 libbinder \ 212 libbase \ 213 libutils \ 214 libcutils \ 215 liblog \ 216 libm \ 217 libc \ 218 libhidlbase \ 219 libhidltransport \ 220 android.hardware.health@1.0 \ 221 222include $(BUILD_EXECUTABLE) 223