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