blob: 1d238b1ef1232778f0d48efca58282f9c3a199eb [file] [log] [blame]
Todd Poynor752faf22013-06-12 13:25:59 -07001# Copyright 2013 The Android Open Source Project
2
3ifneq ($(BUILD_TINY_ANDROID),true)
4
5LOCAL_PATH := $(call my-dir)
Todd Poynord65104c2013-08-13 15:50:42 -07006
7include $(CLEAR_VARS)
8LOCAL_SRC_FILES := healthd_board_default.cpp
9LOCAL_MODULE := libhealthd.default
Mark Salyzyn6f5b47f2014-05-15 15:00:59 -070010LOCAL_CFLAGS := -Werror
Todd Poynord65104c2013-08-13 15:50:42 -070011include $(BUILD_STATIC_LIBRARY)
12
Todd Poynor752faf22013-06-12 13:25:59 -070013include $(CLEAR_VARS)
14
15LOCAL_SRC_FILES := \
16 healthd.cpp \
Todd Poynorc7464c92013-09-10 12:40:00 -070017 healthd_mode_android.cpp \
Todd Poynorfea5b4d2013-09-09 12:09:08 -070018 healthd_mode_charger.cpp \
Todd Poynor752faf22013-06-12 13:25:59 -070019 BatteryMonitor.cpp \
20 BatteryPropertiesRegistrar.cpp
21
22LOCAL_MODULE := healthd
23LOCAL_MODULE_TAGS := optional
24LOCAL_FORCE_STATIC_EXECUTABLE := true
25LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
26LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
27
Mark Salyzyn6f5b47f2014-05-15 15:00:59 -070028LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror
Todd Poynorfea5b4d2013-09-09 12:09:08 -070029
30ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
31LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
32endif
33
34ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
35LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
36endif
37
38LOCAL_C_INCLUDES := bootable/recovery
39
Doug Zongkeree6ef152014-03-11 08:42:09 -070040LOCAL_STATIC_LIBRARIES := libbatteryservice libbinder libminui libpng libz libutils libstdc++ libcutils liblog libm libc
Todd Poynorfea5b4d2013-09-09 12:09:08 -070041
42ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
43LOCAL_STATIC_LIBRARIES += libsuspend
44endif
45
Todd Poynord65104c2013-08-13 15:50:42 -070046LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -070047
Ying Wangc4d6ade2013-09-20 10:37:42 -070048# Symlink /charger to /sbin/healthd
49LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
50 && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger
51
Todd Poynor752faf22013-06-12 13:25:59 -070052include $(BUILD_EXECUTABLE)
53
Todd Poynorfea5b4d2013-09-09 12:09:08 -070054
55define _add-charger-image
56include $$(CLEAR_VARS)
57LOCAL_MODULE := system_core_charger_$(notdir $(1))
58LOCAL_MODULE_STEM := $(notdir $(1))
59_img_modules += $$(LOCAL_MODULE)
60LOCAL_SRC_FILES := $1
61LOCAL_MODULE_TAGS := optional
62LOCAL_MODULE_CLASS := ETC
63LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
64include $$(BUILD_PREBUILT)
65endef
66
67_img_modules :=
68_images :=
69$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
70 $(eval $(call _add-charger-image,$(_img))))
71
72include $(CLEAR_VARS)
73LOCAL_MODULE := charger_res_images
74LOCAL_MODULE_TAGS := optional
75LOCAL_REQUIRED_MODULES := $(_img_modules)
76include $(BUILD_PHONY_PACKAGE)
77
78_add-charger-image :=
79_img_modules :=
80
Todd Poynor752faf22013-06-12 13:25:59 -070081endif