blob: c1a82c29d802af3aea6d8904e10f6fbf9ccce22f [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 := \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070050 libminui \
51 libpng \
52 libz \
53 libutils \
54 libbase \
55 libcutils \
Luke Song1d540dd2017-07-13 15:10:35 -070056 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070057 liblog \
58 libm \
59 libc \
60
Sandeep Patilfca82442016-11-01 08:29:30 -070061ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
62LOCAL_STATIC_LIBRARIES += libsuspend
63endif
64
Damien Bargiacchi565ba022016-08-11 15:29:50 -070065include $(BUILD_STATIC_LIBRARY)
66
Sandeep Patil6012db52016-11-01 08:45:19 -070067### charger ###
Damien Bargiacchi565ba022016-08-11 15:29:50 -070068include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -080069ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
70LOCAL_CHARGER_NO_UI := true
71endif
72ifdef BRILLO
73LOCAL_CHARGER_NO_UI := true
74endif
75
Todd Poynor752faf22013-06-12 13:25:59 -070076LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -070077 healthd_common.cpp \
78 charger.cpp \
Todd Poynor7c5a3e12016-02-12 19:53:15 -080079
Sandeep Patil6012db52016-11-01 08:45:19 -070080LOCAL_MODULE := charger
Todd Poynor752faf22013-06-12 13:25:59 -070081LOCAL_MODULE_TAGS := optional
82LOCAL_FORCE_STATIC_EXECUTABLE := true
83LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
84LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
Sandeep Patilfca82442016-11-01 08:29:30 -070085LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -070086
Sandeep Patilfca82442016-11-01 08:29:30 -070087LOCAL_CFLAGS := -Werror
Todd Poynor7c5a3e12016-02-12 19:53:15 -080088ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
89LOCAL_CFLAGS += -DCHARGER_NO_UI
90endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070091ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),)
92LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST)
93endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070094ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),)
95LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
96endif
97
Damien Bargiacchi565ba022016-08-11 15:29:50 -070098LOCAL_STATIC_LIBRARIES := \
Sandeep Patilfca82442016-11-01 08:29:30 -070099 libhealthd_charger \
Luke Song1d540dd2017-07-13 15:10:35 -0700100 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700101 libbatterymonitor \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700102 libbase \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700103 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700104 libcutils \
105 liblog \
106 libm \
Damien Bargiacchiafd59e22016-09-13 08:37:37 -0700107 libc \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700108
Sandeep Patilfca82442016-11-01 08:29:30 -0700109ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
110LOCAL_STATIC_LIBRARIES += \
111 libminui \
112 libpng \
113 libz \
114
115endif
116
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700117ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
118LOCAL_STATIC_LIBRARIES += libsuspend
119endif
120
Todd Poynord65104c2013-08-13 15:50:42 -0700121LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700122
Sandeep Patil6012db52016-11-01 08:45:19 -0700123# Symlink /charger to /sbin/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700124LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
Sandeep Patil6012db52016-11-01 08:45:19 -0700125 && ln -sf /sbin/charger $(TARGET_ROOT_OUT)/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700126
Todd Poynor752faf22013-06-12 13:25:59 -0700127include $(BUILD_EXECUTABLE)
128
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800129ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700130define _add-charger-image
131include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700132LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700133LOCAL_MODULE_STEM := $(notdir $(1))
134_img_modules += $$(LOCAL_MODULE)
135LOCAL_SRC_FILES := $1
136LOCAL_MODULE_TAGS := optional
137LOCAL_MODULE_CLASS := ETC
138LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
139include $$(BUILD_PREBUILT)
140endef
141
142_img_modules :=
143_images :=
144$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
145 $(eval $(call _add-charger-image,$(_img))))
146
147include $(CLEAR_VARS)
148LOCAL_MODULE := charger_res_images
149LOCAL_MODULE_TAGS := optional
150LOCAL_REQUIRED_MODULES := $(_img_modules)
151include $(BUILD_PHONY_PACKAGE)
152
153_add-charger-image :=
154_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800155endif # LOCAL_CHARGER_NO_UI