blob: 818488d4ea7639b6ec6833d48f60d4b9bc67caf2 [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 \
Hridya Valsaraju7fa72252018-01-12 17:44:33 -080053 android.hardware.health@1.0-convert \
Hridya Valsaraju89178e72018-01-10 16:14:28 -080054 libhealthstoragedefault \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070055 libminui \
56 libpng \
57 libz \
58 libutils \
59 libbase \
60 libcutils \
Luke Song1d540dd2017-07-13 15:10:35 -070061 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070062 liblog \
63 libm \
64 libc \
65
Sandeep Patilfca82442016-11-01 08:29:30 -070066ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
67LOCAL_STATIC_LIBRARIES += libsuspend
68endif
69
Damien Bargiacchi565ba022016-08-11 15:29:50 -070070include $(BUILD_STATIC_LIBRARY)
71
Sandeep Patil6012db52016-11-01 08:45:19 -070072### charger ###
Damien Bargiacchi565ba022016-08-11 15:29:50 -070073include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -080074ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
75LOCAL_CHARGER_NO_UI := true
76endif
77ifdef BRILLO
78LOCAL_CHARGER_NO_UI := true
79endif
80
Todd Poynor752faf22013-06-12 13:25:59 -070081LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -070082 charger.cpp \
Todd Poynor7c5a3e12016-02-12 19:53:15 -080083
Sandeep Patil6012db52016-11-01 08:45:19 -070084LOCAL_MODULE := charger
Todd Poynor752faf22013-06-12 13:25:59 -070085LOCAL_MODULE_TAGS := optional
86LOCAL_FORCE_STATIC_EXECUTABLE := true
87LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
88LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
Sandeep Patilfca82442016-11-01 08:29:30 -070089LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -070090
Sandeep Patilfca82442016-11-01 08:29:30 -070091LOCAL_CFLAGS := -Werror
Todd Poynor7c5a3e12016-02-12 19:53:15 -080092ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
93LOCAL_CFLAGS += -DCHARGER_NO_UI
94endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070095
Yifan Hongb7cd45f2017-11-13 18:47:03 -080096CHARGER_STATIC_LIBRARIES := \
Yifan Hong10c2b402017-11-08 10:57:52 -080097 android.hardware.health@2.0-impl \
98 android.hardware.health@2.0 \
99 android.hardware.health@1.0 \
Hridya Valsaraju7fa72252018-01-12 17:44:33 -0800100 android.hardware.health@1.0-convert \
Yifan Hong10c2b402017-11-08 10:57:52 -0800101 libhidltransport \
102 libhidlbase \
Pirama Arumuga Nainar9dddfbc2018-04-09 10:40:06 -0700103 libhwbinder_noltopgo \
Hridya Valsaraju89178e72018-01-10 16:14:28 -0800104 libhealthstoragedefault \
Yifan Hong10c2b402017-11-08 10:57:52 -0800105 libvndksupport \
Sandeep Patilfca82442016-11-01 08:29:30 -0700106 libhealthd_charger \
Luke Song1d540dd2017-07-13 15:10:35 -0700107 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700108 libbatterymonitor \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700109 libbase \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700110 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
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800116LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
117
Sandeep Patilfca82442016-11-01 08:29:30 -0700118ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
119LOCAL_STATIC_LIBRARIES += \
120 libminui \
121 libpng \
122 libz \
123
124endif
125
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700126ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
127LOCAL_STATIC_LIBRARIES += libsuspend
128endif
129
Todd Poynord65104c2013-08-13 15:50:42 -0700130LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700131
Sandeep Patil6012db52016-11-01 08:45:19 -0700132# Symlink /charger to /sbin/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700133LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
Sandeep Patil6012db52016-11-01 08:45:19 -0700134 && ln -sf /sbin/charger $(TARGET_ROOT_OUT)/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700135
Todd Poynor752faf22013-06-12 13:25:59 -0700136include $(BUILD_EXECUTABLE)
137
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800138include $(CLEAR_VARS)
139LOCAL_MODULE := charger_test
140LOCAL_MODULE_TAGS := optional
141LOCAL_FORCE_STATIC_EXECUTABLE := true
142LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
143LOCAL_CFLAGS := -Wall -Werror -DCHARGER_TEST -DCHARGER_NO_UI
144LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
145LOCAL_SRC_FILES := \
146 charger.cpp \
147 charger_test.cpp \
148
149include $(BUILD_EXECUTABLE)
150
151CHARGER_STATIC_LIBRARIES :=
152
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800153ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700154define _add-charger-image
155include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700156LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700157LOCAL_MODULE_STEM := $(notdir $(1))
158_img_modules += $$(LOCAL_MODULE)
159LOCAL_SRC_FILES := $1
160LOCAL_MODULE_TAGS := optional
161LOCAL_MODULE_CLASS := ETC
162LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
163include $$(BUILD_PREBUILT)
164endef
165
166_img_modules :=
167_images :=
168$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
169 $(eval $(call _add-charger-image,$(_img))))
170
171include $(CLEAR_VARS)
172LOCAL_MODULE := charger_res_images
173LOCAL_MODULE_TAGS := optional
174LOCAL_REQUIRED_MODULES := $(_img_modules)
175include $(BUILD_PHONY_PACKAGE)
176
177_add-charger-image :=
178_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800179endif # LOCAL_CHARGER_NO_UI