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 | |
| 13 | LOCAL_SRC_FILES := \ |
| 14 | healthd.cpp \ |
Todd Poynor | c7464c9 | 2013-09-10 12:40:00 -0700 | [diff] [blame] | 15 | healthd_mode_android.cpp \ |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 16 | healthd_mode_charger.cpp \ |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 17 | BatteryMonitor.cpp \ |
| 18 | BatteryPropertiesRegistrar.cpp |
| 19 | |
| 20 | LOCAL_MODULE := healthd |
| 21 | LOCAL_MODULE_TAGS := optional |
| 22 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 23 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) |
| 24 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) |
| 25 | |
Mark Salyzyn | 6f5b47f | 2014-05-15 15:00:59 -0700 | [diff] [blame] | 26 | LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 27 | |
| 28 | ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true) |
| 29 | LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK |
| 30 | endif |
| 31 | |
| 32 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 33 | LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND |
| 34 | endif |
| 35 | |
| 36 | LOCAL_C_INCLUDES := bootable/recovery |
| 37 | |
Doug Zongker | ee6ef15 | 2014-03-11 08:42:09 -0700 | [diff] [blame] | 38 | 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] | 39 | |
| 40 | ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) |
| 41 | LOCAL_STATIC_LIBRARIES += libsuspend |
| 42 | endif |
| 43 | |
Todd Poynor | d65104c | 2013-08-13 15:50:42 -0700 | [diff] [blame] | 44 | LOCAL_HAL_STATIC_LIBRARIES := libhealthd |
Todd Poynor | 10b235e | 2013-08-07 15:25:14 -0700 | [diff] [blame] | 45 | |
Ying Wang | c4d6ade | 2013-09-20 10:37:42 -0700 | [diff] [blame] | 46 | # Symlink /charger to /sbin/healthd |
| 47 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \ |
| 48 | && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger |
| 49 | |
Todd Poynor | 752faf2 | 2013-06-12 13:25:59 -0700 | [diff] [blame] | 50 | include $(BUILD_EXECUTABLE) |
| 51 | |
Todd Poynor | fea5b4d | 2013-09-09 12:09:08 -0700 | [diff] [blame] | 52 | |
| 53 | define _add-charger-image |
| 54 | include $$(CLEAR_VARS) |
| 55 | LOCAL_MODULE := system_core_charger_$(notdir $(1)) |
| 56 | LOCAL_MODULE_STEM := $(notdir $(1)) |
| 57 | _img_modules += $$(LOCAL_MODULE) |
| 58 | LOCAL_SRC_FILES := $1 |
| 59 | LOCAL_MODULE_TAGS := optional |
| 60 | LOCAL_MODULE_CLASS := ETC |
| 61 | LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger |
| 62 | include $$(BUILD_PREBUILT) |
| 63 | endef |
| 64 | |
| 65 | _img_modules := |
| 66 | _images := |
| 67 | $(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \ |
| 68 | $(eval $(call _add-charger-image,$(_img)))) |
| 69 | |
| 70 | include $(CLEAR_VARS) |
| 71 | LOCAL_MODULE := charger_res_images |
| 72 | LOCAL_MODULE_TAGS := optional |
| 73 | LOCAL_REQUIRED_MODULES := $(_img_modules) |
| 74 | include $(BUILD_PHONY_PACKAGE) |
| 75 | |
| 76 | _add-charger-image := |
| 77 | _img_modules := |