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