1# Copyright 2013 The Android Open Source Project 2 3ifneq ($(BUILD_TINY_ANDROID),true) 4 5LOCAL_PATH := $(call my-dir) 6 7include $(CLEAR_VARS) 8LOCAL_SRC_FILES := healthd_board_default.cpp 9LOCAL_MODULE := libhealthd.default 10LOCAL_CFLAGS := -Werror 11include $(BUILD_STATIC_LIBRARY) 12 13include $(CLEAR_VARS) 14 15LOCAL_SRC_FILES := \ 16 healthd.cpp \ 17 healthd_mode_android.cpp \ 18 healthd_mode_charger.cpp \ 19 BatteryMonitor.cpp \ 20 BatteryPropertiesRegistrar.cpp 21 22LOCAL_MODULE := healthd 23LOCAL_MODULE_TAGS := optional 24LOCAL_FORCE_STATIC_EXECUTABLE := true 25LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) 26LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) 27 28LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror 29 30ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true) 31LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK 32endif 33 34ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) 35LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND 36endif 37 38LOCAL_C_INCLUDES := bootable/recovery 39 40LOCAL_STATIC_LIBRARIES := libbatteryservice libbinder libminui libpng libz libutils libstdc++ libcutils liblog libm libc 41 42ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) 43LOCAL_STATIC_LIBRARIES += libsuspend 44endif 45 46LOCAL_HAL_STATIC_LIBRARIES := libhealthd 47 48# Symlink /charger to /sbin/healthd 49LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \ 50 && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger 51 52include $(BUILD_EXECUTABLE) 53 54 55define _add-charger-image 56include $$(CLEAR_VARS) 57LOCAL_MODULE := system_core_charger_$(notdir $(1)) 58LOCAL_MODULE_STEM := $(notdir $(1)) 59_img_modules += $$(LOCAL_MODULE) 60LOCAL_SRC_FILES := $1 61LOCAL_MODULE_TAGS := optional 62LOCAL_MODULE_CLASS := ETC 63LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger 64include $$(BUILD_PREBUILT) 65endef 66 67_img_modules := 68_images := 69$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \ 70 $(eval $(call _add-charger-image,$(_img)))) 71 72include $(CLEAR_VARS) 73LOCAL_MODULE := charger_res_images 74LOCAL_MODULE_TAGS := optional 75LOCAL_REQUIRED_MODULES := $(_img_modules) 76include $(BUILD_PHONY_PACKAGE) 77 78_add-charger-image := 79_img_modules := 80 81endif 82