blob: 5cd5ce18639cac69597bcaf5385ca26cea9feca3 [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
10include $(BUILD_STATIC_LIBRARY)
11
Todd Poynor752faf22013-06-12 13:25:59 -070012include $(CLEAR_VARS)
13
14LOCAL_SRC_FILES := \
15 healthd.cpp \
Todd Poynorc7464c92013-09-10 12:40:00 -070016 healthd_mode_android.cpp \
Todd Poynorfea5b4d2013-09-09 12:09:08 -070017 healthd_mode_charger.cpp \
Todd Poynor752faf22013-06-12 13:25:59 -070018 BatteryMonitor.cpp \
19 BatteryPropertiesRegistrar.cpp
20
21LOCAL_MODULE := healthd
22LOCAL_MODULE_TAGS := optional
23LOCAL_FORCE_STATIC_EXECUTABLE := true
24LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
25LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
26
Todd Poynorfea5b4d2013-09-09 12:09:08 -070027LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS
28
29ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
30LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
31endif
32
33ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
34LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
35endif
36
37LOCAL_C_INCLUDES := bootable/recovery
38
39LOCAL_STATIC_LIBRARIES := libbatteryservice libbinder libminui libpixelflinger_static libpng libz libutils libstdc++ libcutils liblog libm libc
40
41ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
42LOCAL_STATIC_LIBRARIES += libsuspend
43endif
44
Todd Poynord65104c2013-08-13 15:50:42 -070045LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -070046
Ying Wangc4d6ade2013-09-20 10:37:42 -070047# Symlink /charger to /sbin/healthd
48LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
49 && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger
50
Todd Poynor752faf22013-06-12 13:25:59 -070051include $(BUILD_EXECUTABLE)
52
Todd Poynorfea5b4d2013-09-09 12:09:08 -070053
54define _add-charger-image
55include $$(CLEAR_VARS)
56LOCAL_MODULE := system_core_charger_$(notdir $(1))
57LOCAL_MODULE_STEM := $(notdir $(1))
58_img_modules += $$(LOCAL_MODULE)
59LOCAL_SRC_FILES := $1
60LOCAL_MODULE_TAGS := optional
61LOCAL_MODULE_CLASS := ETC
62LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
63include $$(BUILD_PREBUILT)
64endef
65
66_img_modules :=
67_images :=
68$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
69 $(eval $(call _add-charger-image,$(_img))))
70
71include $(CLEAR_VARS)
72LOCAL_MODULE := charger_res_images
73LOCAL_MODULE_TAGS := optional
74LOCAL_REQUIRED_MODULES := $(_img_modules)
75include $(BUILD_PHONY_PACKAGE)
76
77_add-charger-image :=
78_img_modules :=
79
Todd Poynor752faf22013-06-12 13:25:59 -070080endif