blob: d18f15a0cd60c357806d959819125cc0338264b2 [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
Tao Baof2455d82018-09-07 12:52:46 -07005### libhealthd_draw ###
Todd Poynord65104c2013-08-13 15:50:42 -07006include $(CLEAR_VARS)
Sandeep Patilfca82442016-11-01 08:29:30 -07007
Luke Song1d540dd2017-07-13 15:10:35 -07008LOCAL_MODULE := libhealthd_draw
9
10LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
Tao Baof2455d82018-09-07 12:52:46 -070011LOCAL_STATIC_LIBRARIES := libminui
12LOCAL_SHARED_LIBRARIES := libbase
Luke Song1d540dd2017-07-13 15:10:35 -070013LOCAL_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
Yifan Hong9a81d542018-05-04 13:53:41 -070027LOCAL_HEADER_LIBRARIES := libbatteryservice_headers
28
Luke Song1d540dd2017-07-13 15:10:35 -070029include $(BUILD_STATIC_LIBRARY)
30
Tao Baof2455d82018-09-07 12:52:46 -070031### libhealthd_charger ###
Luke Song1d540dd2017-07-13 15:10:35 -070032include $(CLEAR_VARS)
33
Sandeep Patilfca82442016-11-01 08:29:30 -070034LOCAL_CFLAGS := -Werror
35ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
36LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
37endif
38ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
39LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
40endif
41
42LOCAL_SRC_FILES := \
43 healthd_mode_charger.cpp \
44 AnimationParser.cpp
45
46LOCAL_MODULE := libhealthd_charger
Tao Baob6ccc782018-09-06 15:13:47 -070047LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Sandeep Patilfca82442016-11-01 08:29:30 -070048LOCAL_EXPORT_C_INCLUDE_DIRS := \
49 $(LOCAL_PATH) \
50 $(LOCAL_PATH)/include
51
52LOCAL_STATIC_LIBRARIES := \
Hridya Valsarajuffb13032017-12-11 17:32:22 -080053 android.hardware.health@2.0-impl \
Hridya Valsaraju7fa72252018-01-12 17:44:33 -080054 android.hardware.health@1.0-convert \
Hridya Valsaraju89178e72018-01-10 16:14:28 -080055 libhealthstoragedefault \
Tao Baof2455d82018-09-07 12:52:46 -070056 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070057 libminui \
Tao Baof2455d82018-09-07 12:52:46 -070058
59LOCAL_SHARED_LIBRARIES := \
60 android.hardware.health@2.0 \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070061 libbase \
62 libcutils \
63 liblog \
Tao Baof2455d82018-09-07 12:52:46 -070064 libpng \
65 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070066
Sandeep Patilfca82442016-11-01 08:29:30 -070067ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
Tao Baof2455d82018-09-07 12:52:46 -070068LOCAL_SHARED_LIBRARIES += libsuspend
Sandeep Patilfca82442016-11-01 08:29:30 -070069endif
70
Damien Bargiacchi565ba022016-08-11 15:29:50 -070071include $(BUILD_STATIC_LIBRARY)
72
Sandeep Patil6012db52016-11-01 08:45:19 -070073### charger ###
Damien Bargiacchi565ba022016-08-11 15:29:50 -070074include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -080075ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
76LOCAL_CHARGER_NO_UI := true
77endif
Todd Poynor7c5a3e12016-02-12 19:53:15 -080078
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
Sandeep Patilfca82442016-11-01 08:29:30 -070083LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -070084
Sandeep Patilfca82442016-11-01 08:29:30 -070085LOCAL_CFLAGS := -Werror
Todd Poynor7c5a3e12016-02-12 19:53:15 -080086ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
87LOCAL_CFLAGS += -DCHARGER_NO_UI
88endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070089
Yifan Hongb7cd45f2017-11-13 18:47:03 -080090CHARGER_STATIC_LIBRARIES := \
Yifan Hong10c2b402017-11-08 10:57:52 -080091 android.hardware.health@2.0-impl \
Hridya Valsaraju7fa72252018-01-12 17:44:33 -080092 android.hardware.health@1.0-convert \
Jayant Chowdharyc2d39492018-10-01 22:50:07 +000093 libbinderthreadstate \
Yifan Hong10c2b402017-11-08 10:57:52 -080094 libhidltransport \
95 libhidlbase \
Pirama Arumuga Nainar9dddfbc2018-04-09 10:40:06 -070096 libhwbinder_noltopgo \
Hridya Valsaraju89178e72018-01-10 16:14:28 -080097 libhealthstoragedefault \
Yifan Hong10c2b402017-11-08 10:57:52 -080098 libvndksupport \
Sandeep Patilfca82442016-11-01 08:29:30 -070099 libhealthd_charger \
Tao Bao5747e222018-09-11 10:46:35 -0700100 libhealthd_charger_nops \
Luke Song1d540dd2017-07-13 15:10:35 -0700101 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700102 libbatterymonitor \
Tao Baof2455d82018-09-07 12:52:46 -0700103
104CHARGER_SHARED_LIBRARIES := \
105 android.hardware.health@2.0 \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700106 libbase \
107 libcutils \
Suren Baghdasaryan82b72a52018-12-21 11:41:50 -0800108 libjsoncpp \
Suren Baghdasaryan94910782019-01-25 05:32:52 +0000109 libprocessgroup \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700110 liblog \
Tao Baof2455d82018-09-07 12:52:46 -0700111 libutils \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700112
Sandeep Patilfca82442016-11-01 08:29:30 -0700113ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Tao Bao5747e222018-09-11 10:46:35 -0700114CHARGER_STATIC_LIBRARIES += libminui
115CHARGER_SHARED_LIBRARIES += libpng
Sandeep Patilfca82442016-11-01 08:29:30 -0700116endif
117
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700118ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
Tao Bao5747e222018-09-11 10:46:35 -0700119CHARGER_SHARED_LIBRARIES += libsuspend
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700120endif
121
Tao Bao5747e222018-09-11 10:46:35 -0700122LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
123LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
124
Todd Poynord65104c2013-08-13 15:50:42 -0700125LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700126
Tao Baof2455d82018-09-07 12:52:46 -0700127# Symlink /charger to /system/bin/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700128LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
Tao Baof2455d82018-09-07 12:52:46 -0700129 && ln -sf /system/bin/charger $(TARGET_ROOT_OUT)/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700130
Todd Poynor752faf22013-06-12 13:25:59 -0700131include $(BUILD_EXECUTABLE)
132
Tao Bao5747e222018-09-11 10:46:35 -0700133### charger.recovery ###
134include $(CLEAR_VARS)
135
136LOCAL_SRC_FILES := \
137 charger.cpp \
138
139LOCAL_MODULE := charger.recovery
140LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
141LOCAL_MODULE_STEM := charger
142
143LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
144LOCAL_CFLAGS := -Wall -Werror
145LOCAL_CFLAGS += -DCHARGER_NO_UI
146
147# charger.recovery doesn't link against libhealthd_{charger,draw} or libminui, since it doesn't need
148# any UI support.
149LOCAL_STATIC_LIBRARIES := \
150 android.hardware.health@2.0-impl \
151 android.hardware.health@1.0-convert \
152 libbinderthreadstate \
153 libhidltransport \
154 libhidlbase \
155 libhwbinder_noltopgo \
156 libhealthstoragedefault \
157 libvndksupport \
158 libhealthd_charger_nops \
159 libbatterymonitor \
160
161# These shared libs will be installed to recovery image because of the dependency in `recovery`
162# module.
163LOCAL_SHARED_LIBRARIES := \
164 android.hardware.health@2.0 \
165 libbase \
166 libcutils \
167 liblog \
168 libutils \
169
170# The use of LOCAL_HAL_STATIC_LIBRARIES prevents from building this module with Android.bp.
171LOCAL_HAL_STATIC_LIBRARIES := libhealthd
172
173include $(BUILD_EXECUTABLE)
174
Tao Baof2455d82018-09-07 12:52:46 -0700175### charger_test ###
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800176include $(CLEAR_VARS)
177LOCAL_MODULE := charger_test
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800178LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Tao Bao5747e222018-09-11 10:46:35 -0700179LOCAL_CFLAGS := -Wall -Werror -DCHARGER_NO_UI
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800180LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
Tao Baof2455d82018-09-07 12:52:46 -0700181LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800182LOCAL_SRC_FILES := \
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800183 charger_test.cpp \
184
185include $(BUILD_EXECUTABLE)
186
187CHARGER_STATIC_LIBRARIES :=
Tao Baof2455d82018-09-07 12:52:46 -0700188CHARGER_SHARED_LIBRARIES :=
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800189
Tao Baof2455d82018-09-07 12:52:46 -0700190### charger_res_images ###
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800191ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700192define _add-charger-image
193include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700194LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700195LOCAL_MODULE_STEM := $(notdir $(1))
196_img_modules += $$(LOCAL_MODULE)
197LOCAL_SRC_FILES := $1
198LOCAL_MODULE_TAGS := optional
199LOCAL_MODULE_CLASS := ETC
200LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
201include $$(BUILD_PREBUILT)
202endef
203
204_img_modules :=
205_images :=
206$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
207 $(eval $(call _add-charger-image,$(_img))))
208
209include $(CLEAR_VARS)
210LOCAL_MODULE := charger_res_images
211LOCAL_MODULE_TAGS := optional
212LOCAL_REQUIRED_MODULES := $(_img_modules)
213include $(BUILD_PHONY_PACKAGE)
214
215_add-charger-image :=
216_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800217endif # LOCAL_CHARGER_NO_UI