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