blob: 9096f79324be1896b51ba8cb868733fabe51dc85 [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
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
31include $(CLEAR_VARS)
32
Sandeep Patilfca82442016-11-01 08:29:30 -070033LOCAL_CFLAGS := -Werror
34ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
35LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
36endif
37ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
38LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
39endif
40
41LOCAL_SRC_FILES := \
42 healthd_mode_charger.cpp \
43 AnimationParser.cpp
44
45LOCAL_MODULE := libhealthd_charger
Tao Baob6ccc782018-09-06 15:13:47 -070046LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Sandeep Patilfca82442016-11-01 08:29:30 -070047LOCAL_EXPORT_C_INCLUDE_DIRS := \
48 $(LOCAL_PATH) \
49 $(LOCAL_PATH)/include
50
51LOCAL_STATIC_LIBRARIES := \
Yifan Hong10c2b402017-11-08 10:57:52 -080052 android.hardware.health@2.0 \
Hridya Valsarajuffb13032017-12-11 17:32:22 -080053 android.hardware.health@2.0-impl \
Yifan Hong10c2b402017-11-08 10:57:52 -080054 android.hardware.health@1.0 \
Hridya Valsaraju7fa72252018-01-12 17:44:33 -080055 android.hardware.health@1.0-convert \
Hridya Valsaraju89178e72018-01-10 16:14:28 -080056 libhealthstoragedefault \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070057 libminui \
58 libpng \
59 libz \
60 libutils \
61 libbase \
62 libcutils \
Luke Song1d540dd2017-07-13 15:10:35 -070063 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070064 liblog \
65 libm \
66 libc \
67
Sandeep Patilfca82442016-11-01 08:29:30 -070068ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
69LOCAL_STATIC_LIBRARIES += libsuspend
70endif
71
Damien Bargiacchi565ba022016-08-11 15:29:50 -070072include $(BUILD_STATIC_LIBRARY)
73
Sandeep Patil6012db52016-11-01 08:45:19 -070074### charger ###
Damien Bargiacchi565ba022016-08-11 15:29:50 -070075include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -080076ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
77LOCAL_CHARGER_NO_UI := true
78endif
Todd Poynor7c5a3e12016-02-12 19:53:15 -080079
Todd Poynor752faf22013-06-12 13:25:59 -070080LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -070081 charger.cpp \
Todd Poynor7c5a3e12016-02-12 19:53:15 -080082
Sandeep Patil6012db52016-11-01 08:45:19 -070083LOCAL_MODULE := charger
Todd Poynor752faf22013-06-12 13:25:59 -070084LOCAL_MODULE_TAGS := optional
85LOCAL_FORCE_STATIC_EXECUTABLE := true
86LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
87LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
Sandeep Patilfca82442016-11-01 08:29:30 -070088LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -070089
Sandeep Patilfca82442016-11-01 08:29:30 -070090LOCAL_CFLAGS := -Werror
Todd Poynor7c5a3e12016-02-12 19:53:15 -080091ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
92LOCAL_CFLAGS += -DCHARGER_NO_UI
93endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070094
Yifan Hongb7cd45f2017-11-13 18:47:03 -080095CHARGER_STATIC_LIBRARIES := \
Yifan Hong10c2b402017-11-08 10:57:52 -080096 android.hardware.health@2.0-impl \
97 android.hardware.health@2.0 \
98 android.hardware.health@1.0 \
Hridya Valsaraju7fa72252018-01-12 17:44:33 -080099 android.hardware.health@1.0-convert \
Yifan Hong10c2b402017-11-08 10:57:52 -0800100 libhidltransport \
101 libhidlbase \
Pirama Arumuga Nainar9dddfbc2018-04-09 10:40:06 -0700102 libhwbinder_noltopgo \
Hridya Valsaraju89178e72018-01-10 16:14:28 -0800103 libhealthstoragedefault \
Yifan Hong10c2b402017-11-08 10:57:52 -0800104 libvndksupport \
Sandeep Patilfca82442016-11-01 08:29:30 -0700105 libhealthd_charger \
Luke Song1d540dd2017-07-13 15:10:35 -0700106 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700107 libbatterymonitor \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700108 libbase \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700109 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700110 libcutils \
111 liblog \
112 libm \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700113 libc \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700114
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800115LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
116
Sandeep Patilfca82442016-11-01 08:29:30 -0700117ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
118LOCAL_STATIC_LIBRARIES += \
119 libminui \
120 libpng \
121 libz \
122
123endif
124
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700125ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
126LOCAL_STATIC_LIBRARIES += libsuspend
127endif
128
Todd Poynord65104c2013-08-13 15:50:42 -0700129LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700130
Sandeep Patil6012db52016-11-01 08:45:19 -0700131# Symlink /charger to /sbin/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700132LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
Sandeep Patil6012db52016-11-01 08:45:19 -0700133 && ln -sf /sbin/charger $(TARGET_ROOT_OUT)/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700134
Todd Poynor752faf22013-06-12 13:25:59 -0700135include $(BUILD_EXECUTABLE)
136
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800137include $(CLEAR_VARS)
138LOCAL_MODULE := charger_test
139LOCAL_MODULE_TAGS := optional
140LOCAL_FORCE_STATIC_EXECUTABLE := true
141LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
142LOCAL_CFLAGS := -Wall -Werror -DCHARGER_TEST -DCHARGER_NO_UI
143LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
144LOCAL_SRC_FILES := \
145 charger.cpp \
146 charger_test.cpp \
147
148include $(BUILD_EXECUTABLE)
149
150CHARGER_STATIC_LIBRARIES :=
151
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800152ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700153define _add-charger-image
154include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700155LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700156LOCAL_MODULE_STEM := $(notdir $(1))
157_img_modules += $$(LOCAL_MODULE)
158LOCAL_SRC_FILES := $1
159LOCAL_MODULE_TAGS := optional
160LOCAL_MODULE_CLASS := ETC
161LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
162include $$(BUILD_PREBUILT)
163endef
164
165_img_modules :=
166_images :=
167$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
168 $(eval $(call _add-charger-image,$(_img))))
169
170include $(CLEAR_VARS)
171LOCAL_MODULE := charger_res_images
172LOCAL_MODULE_TAGS := optional
173LOCAL_REQUIRED_MODULES := $(_img_modules)
174include $(BUILD_PHONY_PACKAGE)
175
176_add-charger-image :=
177_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800178endif # LOCAL_CHARGER_NO_UI