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