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