blob: 5f10f1e8cea9a2ac7f40fcc14915cb323904cc6a [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 \
51 android.hardware.health@1.0 \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070052 libminui \
53 libpng \
54 libz \
55 libutils \
56 libbase \
57 libcutils \
Luke Song1d540dd2017-07-13 15:10:35 -070058 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070059 liblog \
60 libm \
61 libc \
62
Sandeep Patilfca82442016-11-01 08:29:30 -070063ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
64LOCAL_STATIC_LIBRARIES += libsuspend
65endif
66
Damien Bargiacchi565ba022016-08-11 15:29:50 -070067include $(BUILD_STATIC_LIBRARY)
68
Sandeep Patil6012db52016-11-01 08:45:19 -070069### charger ###
Damien Bargiacchi565ba022016-08-11 15:29:50 -070070include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -080071ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
72LOCAL_CHARGER_NO_UI := true
73endif
74ifdef BRILLO
75LOCAL_CHARGER_NO_UI := true
76endif
77
Todd Poynor752faf22013-06-12 13:25:59 -070078LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -070079 charger.cpp \
Todd Poynor7c5a3e12016-02-12 19:53:15 -080080
Sandeep Patil6012db52016-11-01 08:45:19 -070081LOCAL_MODULE := charger
Todd Poynor752faf22013-06-12 13:25:59 -070082LOCAL_MODULE_TAGS := optional
83LOCAL_FORCE_STATIC_EXECUTABLE := true
84LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
85LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
Sandeep Patilfca82442016-11-01 08:29:30 -070086LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -070087
Sandeep Patilfca82442016-11-01 08:29:30 -070088LOCAL_CFLAGS := -Werror
Todd Poynor7c5a3e12016-02-12 19:53:15 -080089ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
90LOCAL_CFLAGS += -DCHARGER_NO_UI
91endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070092ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),)
93LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST)
94endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070095ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),)
96LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
97endif
98
Yifan Hongb7cd45f2017-11-13 18:47:03 -080099CHARGER_STATIC_LIBRARIES := \
Yifan Hong10c2b402017-11-08 10:57:52 -0800100 android.hardware.health@2.0-impl \
101 android.hardware.health@2.0 \
102 android.hardware.health@1.0 \
103 libhidltransport \
104 libhidlbase \
105 libhwbinder \
106 libvndksupport \
Sandeep Patilfca82442016-11-01 08:29:30 -0700107 libhealthd_charger \
Luke Song1d540dd2017-07-13 15:10:35 -0700108 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700109 libbatterymonitor \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700110 libbase \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700111 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700112 libcutils \
113 liblog \
114 libm \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700115 libc \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700116
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800117LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
118
Sandeep Patilfca82442016-11-01 08:29:30 -0700119ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
120LOCAL_STATIC_LIBRARIES += \
121 libminui \
122 libpng \
123 libz \
124
125endif
126
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700127ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
128LOCAL_STATIC_LIBRARIES += libsuspend
129endif
130
Todd Poynord65104c2013-08-13 15:50:42 -0700131LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700132
Sandeep Patil6012db52016-11-01 08:45:19 -0700133# Symlink /charger to /sbin/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700134LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
Sandeep Patil6012db52016-11-01 08:45:19 -0700135 && ln -sf /sbin/charger $(TARGET_ROOT_OUT)/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700136
Todd Poynor752faf22013-06-12 13:25:59 -0700137include $(BUILD_EXECUTABLE)
138
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800139include $(CLEAR_VARS)
140LOCAL_MODULE := charger_test
141LOCAL_MODULE_TAGS := optional
142LOCAL_FORCE_STATIC_EXECUTABLE := true
143LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
144LOCAL_CFLAGS := -Wall -Werror -DCHARGER_TEST -DCHARGER_NO_UI
145LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
146LOCAL_SRC_FILES := \
147 charger.cpp \
148 charger_test.cpp \
149
150include $(BUILD_EXECUTABLE)
151
152CHARGER_STATIC_LIBRARIES :=
153
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800154ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700155define _add-charger-image
156include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700157LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700158LOCAL_MODULE_STEM := $(notdir $(1))
159_img_modules += $$(LOCAL_MODULE)
160LOCAL_SRC_FILES := $1
161LOCAL_MODULE_TAGS := optional
162LOCAL_MODULE_CLASS := ETC
163LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
164include $$(BUILD_PREBUILT)
165endef
166
167_img_modules :=
168_images :=
169$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
170 $(eval $(call _add-charger-image,$(_img))))
171
172include $(CLEAR_VARS)
173LOCAL_MODULE := charger_res_images
174LOCAL_MODULE_TAGS := optional
175LOCAL_REQUIRED_MODULES := $(_img_modules)
176include $(BUILD_PHONY_PACKAGE)
177
178_add-charger-image :=
179_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800180endif # LOCAL_CHARGER_NO_UI