blob: 7c5e35bac3378e2be367ad995c81a2e1826f3a20 [file] [log] [blame]
Todd Poynor752faf22013-06-12 13:25:59 -07001# Copyright 2013 The Android Open Source Project
2
Todd Poynor752faf22013-06-12 13:25:59 -07003LOCAL_PATH := $(call my-dir)
Todd Poynord65104c2013-08-13 15:50:42 -07004
5include $(CLEAR_VARS)
6LOCAL_SRC_FILES := healthd_board_default.cpp
7LOCAL_MODULE := libhealthd.default
Mark Salyzyn6f5b47f2014-05-15 15:00:59 -07008LOCAL_CFLAGS := -Werror
Yabin Cuie98e1772016-02-17 12:21:34 -08009LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
10LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Christopher Wiley22399082016-04-12 09:21:51 -070011LOCAL_STATIC_LIBRARIES := libbinder
Christopher Wiley8ac71c72016-04-18 09:33:53 -070012LOCAL_EXPORT_STATIC_LIBRARY_HEADERS := libbinder
Yabin Cuie98e1772016-02-17 12:21:34 -080013include $(BUILD_STATIC_LIBRARY)
14
15include $(CLEAR_VARS)
16LOCAL_SRC_FILES := BatteryMonitor.cpp
17LOCAL_MODULE := libbatterymonitor
18LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
19LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Michael Scott3217c5c2016-06-05 11:20:13 -070020LOCAL_STATIC_LIBRARIES := libutils libbase libbinder
Todd Poynord65104c2013-08-13 15:50:42 -070021include $(BUILD_STATIC_LIBRARY)
22
Todd Poynor752faf22013-06-12 13:25:59 -070023include $(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -070024LOCAL_SRC_FILES := \
25 healthd_mode_android.cpp \
26 healthd_mode_charger.cpp \
27 AnimationParser.cpp \
28 BatteryPropertiesRegistrar.cpp \
29
30LOCAL_MODULE := libhealthd_internal
31LOCAL_C_INCLUDES := bootable/recovery
32LOCAL_EXPORT_C_INCLUDE_DIRS := \
33 $(LOCAL_PATH) \
34 $(LOCAL_PATH)/include \
35
36LOCAL_STATIC_LIBRARIES := \
37 libbatterymonitor \
38 libbatteryservice \
39 libbinder \
40 libminui \
41 libpng \
42 libz \
43 libutils \
44 libbase \
45 libcutils \
46 liblog \
47 libm \
48 libc \
49
50include $(BUILD_STATIC_LIBRARY)
51
52
53include $(CLEAR_VARS)
Todd Poynor752faf22013-06-12 13:25:59 -070054
Todd Poynor7c5a3e12016-02-12 19:53:15 -080055ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
56LOCAL_CHARGER_NO_UI := true
57endif
58ifdef BRILLO
59LOCAL_CHARGER_NO_UI := true
60endif
61
Todd Poynor752faf22013-06-12 13:25:59 -070062LOCAL_SRC_FILES := \
63 healthd.cpp \
Todd Poynorc7464c92013-09-10 12:40:00 -070064 healthd_mode_android.cpp \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -070065 BatteryPropertiesRegistrar.cpp \
Todd Poynor752faf22013-06-12 13:25:59 -070066
Todd Poynor7c5a3e12016-02-12 19:53:15 -080067ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
68LOCAL_SRC_FILES += healthd_mode_charger.cpp
69endif
70
Todd Poynor752faf22013-06-12 13:25:59 -070071LOCAL_MODULE := healthd
72LOCAL_MODULE_TAGS := optional
73LOCAL_FORCE_STATIC_EXECUTABLE := true
74LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
75LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
76
Mark Salyzyn6f5b47f2014-05-15 15:00:59 -070077LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror
Todd Poynorfea5b4d2013-09-09 12:09:08 -070078
79ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
80LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
81endif
82
83ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
84LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
85endif
86
Todd Poynor7c5a3e12016-02-12 19:53:15 -080087ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
88LOCAL_CFLAGS += -DCHARGER_NO_UI
89endif
90
Yabin Cuie98e1772016-02-17 12:21:34 -080091LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include
Todd Poynorfea5b4d2013-09-09 12:09:08 -070092
Damien Bargiacchi565ba022016-08-11 15:29:50 -070093LOCAL_STATIC_LIBRARIES := \
94 libhealthd_internal \
95 libbatterymonitor \
96 libbatteryservice \
97 libbinder \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070098 libbase \
Todd Poynor7c5a3e12016-02-12 19:53:15 -080099
100ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700101LOCAL_STATIC_LIBRARIES += \
102 libminui \
103 libpng \
104 libz \
105
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800106endif
107
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700108
109LOCAL_STATIC_LIBRARIES += \
110 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700111 libcutils \
112 liblog \
113 libm \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700114 libc \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700115
116ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
117LOCAL_STATIC_LIBRARIES += libsuspend
118endif
119
Todd Poynord65104c2013-08-13 15:50:42 -0700120LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700121
Ying Wangc4d6ade2013-09-20 10:37:42 -0700122# Symlink /charger to /sbin/healthd
123LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
124 && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger
125
Todd Poynor752faf22013-06-12 13:25:59 -0700126include $(BUILD_EXECUTABLE)
127
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700128
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800129ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700130define _add-charger-image
131include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700132LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700133LOCAL_MODULE_STEM := $(notdir $(1))
134_img_modules += $$(LOCAL_MODULE)
135LOCAL_SRC_FILES := $1
136LOCAL_MODULE_TAGS := optional
137LOCAL_MODULE_CLASS := ETC
138LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
139include $$(BUILD_PREBUILT)
140endef
141
142_img_modules :=
143_images :=
144$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
145 $(eval $(call _add-charger-image,$(_img))))
146
147include $(CLEAR_VARS)
148LOCAL_MODULE := charger_res_images
149LOCAL_MODULE_TAGS := optional
150LOCAL_REQUIRED_MODULES := $(_img_modules)
151include $(BUILD_PHONY_PACKAGE)
152
153_add-charger-image :=
154_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800155endif # LOCAL_CHARGER_NO_UI