2013-06-13 04:25:59 +08:00
|
|
|
# Copyright 2013 The Android Open Source Project
|
|
|
|
|
|
|
|
ifneq ($(BUILD_TINY_ANDROID),true)
|
|
|
|
|
|
|
|
LOCAL_PATH := $(call my-dir)
|
2013-08-14 06:50:42 +08:00
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_SRC_FILES := healthd_board_default.cpp
|
|
|
|
LOCAL_MODULE := libhealthd.default
|
|
|
|
include $(BUILD_STATIC_LIBRARY)
|
|
|
|
|
2013-06-13 04:25:59 +08:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
healthd.cpp \
|
2013-09-11 03:40:00 +08:00
|
|
|
healthd_mode_android.cpp \
|
2013-09-10 03:09:08 +08:00
|
|
|
healthd_mode_charger.cpp \
|
2013-06-13 04:25:59 +08:00
|
|
|
BatteryMonitor.cpp \
|
|
|
|
BatteryPropertiesRegistrar.cpp
|
|
|
|
|
|
|
|
LOCAL_MODULE := healthd
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_FORCE_STATIC_EXECUTABLE := true
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
|
|
|
|
LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
|
|
|
|
|
2013-09-10 03:09:08 +08:00
|
|
|
LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS
|
|
|
|
|
|
|
|
ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
|
|
|
|
LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
|
|
|
|
LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
|
|
|
|
endif
|
|
|
|
|
|
|
|
LOCAL_C_INCLUDES := bootable/recovery
|
|
|
|
|
|
|
|
LOCAL_STATIC_LIBRARIES := libbatteryservice libbinder libminui libpixelflinger_static libpng libz libutils libstdc++ libcutils liblog libm libc
|
|
|
|
|
|
|
|
ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
|
|
|
|
LOCAL_STATIC_LIBRARIES += libsuspend
|
|
|
|
endif
|
|
|
|
|
2013-08-14 06:50:42 +08:00
|
|
|
LOCAL_HAL_STATIC_LIBRARIES := libhealthd
|
2013-08-08 06:25:14 +08:00
|
|
|
|
2013-06-13 04:25:59 +08:00
|
|
|
include $(BUILD_EXECUTABLE)
|
|
|
|
|
2013-09-10 03:09:08 +08:00
|
|
|
# Symlink /charger to /sbin/healthd
|
|
|
|
SYMLINKS := \
|
|
|
|
$(TARGET_ROOT_OUT)/charger
|
|
|
|
|
|
|
|
$(SYMLINKS): HEALTHD_BINARY := $(LOCAL_MODULE)
|
|
|
|
$(SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk
|
|
|
|
@echo "Symlink: $@ -> /sbin/$(HEALTHD_BINARY)"
|
|
|
|
@rm -rf $@
|
|
|
|
$(hide) ln -sf /sbin/$(HEALTHD_BINARY) $@
|
|
|
|
|
|
|
|
ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS)
|
|
|
|
|
|
|
|
# We need this so that the installed files could be picked up based on the
|
|
|
|
# local module name
|
|
|
|
ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
|
|
|
|
$(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS)
|
|
|
|
|
|
|
|
define _add-charger-image
|
|
|
|
include $$(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := system_core_charger_$(notdir $(1))
|
|
|
|
LOCAL_MODULE_STEM := $(notdir $(1))
|
|
|
|
_img_modules += $$(LOCAL_MODULE)
|
|
|
|
LOCAL_SRC_FILES := $1
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
|
|
|
|
include $$(BUILD_PREBUILT)
|
|
|
|
endef
|
|
|
|
|
|
|
|
_img_modules :=
|
|
|
|
_images :=
|
|
|
|
$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
|
|
|
|
$(eval $(call _add-charger-image,$(_img))))
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := charger_res_images
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_REQUIRED_MODULES := $(_img_modules)
|
|
|
|
include $(BUILD_PHONY_PACKAGE)
|
|
|
|
|
|
|
|
_add-charger-image :=
|
|
|
|
_img_modules :=
|
|
|
|
|
2013-06-13 04:25:59 +08:00
|
|
|
endif
|