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