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