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 |
Mark Salyzyn | 6f5b47f | 2014-05-15 15:00:59 -0700 | [diff] [blame] | 10 | LOCAL_CFLAGS := -Werror |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 11 | include $(BUILD_STATIC_LIBRARY) |
| 12 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 13 | include $(CLEAR_VARS) |
| 14 | |
| 15 | LOCAL_SRC_FILES := \ |
| 16 | healthd.cpp \ |
Todd Poynor | c7464c9 | 2013-09-10 12:40:00 -0700 | [diff] [blame] | 17 | healthd_mode_android.cpp \ |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 18 | healthd_mode_charger.cpp \ |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 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 | |
Mark Salyzyn | 6f5b47f | 2014-05-15 15:00:59 -0700 | [diff] [blame] | 28 | LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 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 | |
Doug Zongker | ee6ef15 | 2014-03-11 08:42:09 -0700 | [diff] [blame] | 40 | LOCAL_STATIC_LIBRARIES := libbatteryservice libbinder libminui libpng libz libutils libstdc++ libcutils liblog libm libc |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 41 | |
| 42 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 43 | LOCAL_STATIC_LIBRARIES += libsuspend |
| 44 | endif |
| 45 | |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 46 | LOCAL_HAL_STATIC_LIBRARIES := libhealthd |
Todd Poynor | 10b235e | 2013-08-07 15:25:14 -0700 | [diff] [blame] | 47 | |
Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 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 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 52 | include $(BUILD_EXECUTABLE) |
| 53 | |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 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 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 81 | endif |