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