blob: 7e58785d67701e8114df75bdb1b3005a7ab19185 [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)
Sandeep Patilfca82442016-11-01 08:29:30 -07006
Luke Song1d540dd2017-07-13 15:10:35 -07007LOCAL_MODULE := libhealthd_draw
8
9LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
10LOCAL_STATIC_LIBRARIES := \
11 libminui \
12 libbase
13LOCAL_SRC_FILES := healthd_draw.cpp
14
15ifneq ($(TARGET_HEALTHD_DRAW_SPLIT_SCREEN),)
16LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_SCREEN=$(TARGET_HEALTHD_DRAW_SPLIT_SCREEN)
17else
18LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_SCREEN=0
19endif
20
21ifneq ($(TARGET_HEALTHD_DRAW_SPLIT_OFFSET),)
22LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_OFFSET=$(TARGET_HEALTHD_DRAW_SPLIT_OFFSET)
23else
24LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_OFFSET=0
25endif
26
27include $(BUILD_STATIC_LIBRARY)
28
29include $(CLEAR_VARS)
30
Sandeep Patilfca82442016-11-01 08:29:30 -070031LOCAL_CFLAGS := -Werror
32ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
33LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
34endif
35ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
36LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
37endif
38
39LOCAL_SRC_FILES := \
40 healthd_mode_charger.cpp \
41 AnimationParser.cpp
42
43LOCAL_MODULE := libhealthd_charger
44LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include
45LOCAL_EXPORT_C_INCLUDE_DIRS := \
46 $(LOCAL_PATH) \
47 $(LOCAL_PATH)/include
48
49LOCAL_STATIC_LIBRARIES := \
Yifan Hong10c2b402017-11-08 10:57:52 -080050 android.hardware.health@2.0 \
Hridya Valsarajuffb13032017-12-11 17:32:22 -080051 android.hardware.health@2.0-impl \
Yifan Hong10c2b402017-11-08 10:57:52 -080052 android.hardware.health@1.0 \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070053 libminui \
54 libpng \
55 libz \
56 libutils \
57 libbase \
58 libcutils \
Luke Song1d540dd2017-07-13 15:10:35 -070059 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070060 liblog \
61 libm \
62 libc \
63
Sandeep Patilfca82442016-11-01 08:29:30 -070064ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
65LOCAL_STATIC_LIBRARIES += libsuspend
66endif
67
Damien Bargiacchi565ba022016-08-11 15:29:50 -070068include $(BUILD_STATIC_LIBRARY)
69
Sandeep Patil6012db52016-11-01 08:45:19 -070070### charger ###
Damien Bargiacchi565ba022016-08-11 15:29:50 -070071include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -080072ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
73LOCAL_CHARGER_NO_UI := true
74endif
75ifdef BRILLO
76LOCAL_CHARGER_NO_UI := true
77endif
78
Todd Poynor752faf22013-06-12 13:25:59 -070079LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -070080 charger.cpp \
Todd Poynor7c5a3e12016-02-12 19:53:15 -080081
Sandeep Patil6012db52016-11-01 08:45:19 -070082LOCAL_MODULE := charger
Todd Poynor752faf22013-06-12 13:25:59 -070083LOCAL_MODULE_TAGS := optional
84LOCAL_FORCE_STATIC_EXECUTABLE := true
85LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
86LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
Sandeep Patilfca82442016-11-01 08:29:30 -070087LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -070088
Sandeep Patilfca82442016-11-01 08:29:30 -070089LOCAL_CFLAGS := -Werror
Todd Poynor7c5a3e12016-02-12 19:53:15 -080090ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
91LOCAL_CFLAGS += -DCHARGER_NO_UI
92endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070093
Yifan Hongb7cd45f2017-11-13 18:47:03 -080094CHARGER_STATIC_LIBRARIES := \
Yifan Hong10c2b402017-11-08 10:57:52 -080095 android.hardware.health@2.0-impl \
96 android.hardware.health@2.0 \
97 android.hardware.health@1.0 \
98 libhidltransport \
99 libhidlbase \
100 libhwbinder \
101 libvndksupport \
Sandeep Patilfca82442016-11-01 08:29:30 -0700102 libhealthd_charger \
Luke Song1d540dd2017-07-13 15:10:35 -0700103 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700104 libbatterymonitor \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700105 libbase \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700106 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700107 libcutils \
108 liblog \
109 libm \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700110 libc \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700111
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800112LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
113
Sandeep Patilfca82442016-11-01 08:29:30 -0700114ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
115LOCAL_STATIC_LIBRARIES += \
116 libminui \
117 libpng \
118 libz \
119
120endif
121
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700122ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
123LOCAL_STATIC_LIBRARIES += libsuspend
124endif
125
Todd Poynord65104c2013-08-13 15:50:42 -0700126LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700127
Sandeep Patil6012db52016-11-01 08:45:19 -0700128# Symlink /charger to /sbin/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700129LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
Sandeep Patil6012db52016-11-01 08:45:19 -0700130 && ln -sf /sbin/charger $(TARGET_ROOT_OUT)/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700131
Todd Poynor752faf22013-06-12 13:25:59 -0700132include $(BUILD_EXECUTABLE)
133
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800134include $(CLEAR_VARS)
135LOCAL_MODULE := charger_test
136LOCAL_MODULE_TAGS := optional
137LOCAL_FORCE_STATIC_EXECUTABLE := true
138LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
139LOCAL_CFLAGS := -Wall -Werror -DCHARGER_TEST -DCHARGER_NO_UI
140LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
141LOCAL_SRC_FILES := \
142 charger.cpp \
143 charger_test.cpp \
144
145include $(BUILD_EXECUTABLE)
146
147CHARGER_STATIC_LIBRARIES :=
148
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800149ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700150define _add-charger-image
151include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700152LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700153LOCAL_MODULE_STEM := $(notdir $(1))
154_img_modules += $$(LOCAL_MODULE)
155LOCAL_SRC_FILES := $1
156LOCAL_MODULE_TAGS := optional
157LOCAL_MODULE_CLASS := ETC
158LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
159include $$(BUILD_PREBUILT)
160endef
161
162_img_modules :=
163_images :=
164$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
165 $(eval $(call _add-charger-image,$(_img))))
166
167include $(CLEAR_VARS)
168LOCAL_MODULE := charger_res_images
169LOCAL_MODULE_TAGS := optional
170LOCAL_REQUIRED_MODULES := $(_img_modules)
171include $(BUILD_PHONY_PACKAGE)
172
173_add-charger-image :=
174_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800175endif # LOCAL_CHARGER_NO_UI