blob: b87f3c7a5c2dbd66a4495e0d5f5a8bb24b7d47c2 [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
Sandeep Patil6012db52016-11-01 08:45:19 -07005### charger ###
Damien Bargiacchi565ba022016-08-11 15:29:50 -07006include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -08007ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
8LOCAL_CHARGER_NO_UI := true
9endif
Todd Poynor7c5a3e12016-02-12 19:53:15 -080010
Todd Poynor752faf22013-06-12 13:25:59 -070011LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -070012 charger.cpp \
Todd Poynor7c5a3e12016-02-12 19:53:15 -080013
Sandeep Patil6012db52016-11-01 08:45:19 -070014LOCAL_MODULE := charger
Sandeep Patilfca82442016-11-01 08:29:30 -070015LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -070016
Sandeep Patilfca82442016-11-01 08:29:30 -070017LOCAL_CFLAGS := -Werror
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070018
Yifan Hongb7cd45f2017-11-13 18:47:03 -080019CHARGER_STATIC_LIBRARIES := \
Yifan Hong10c2b402017-11-08 10:57:52 -080020 android.hardware.health@2.0-impl \
Hridya Valsaraju7fa72252018-01-12 17:44:33 -080021 android.hardware.health@1.0-convert \
Jayant Chowdharyc2d39492018-10-01 22:50:07 +000022 libbinderthreadstate \
Yifan Hong97eecdc2019-07-03 11:07:37 -070023 libcharger_sysprop \
Yifan Hong10c2b402017-11-08 10:57:52 -080024 libhidltransport \
25 libhidlbase \
Pirama Arumuga Nainar9dddfbc2018-04-09 10:40:06 -070026 libhwbinder_noltopgo \
Hridya Valsaraju89178e72018-01-10 16:14:28 -080027 libhealthstoragedefault \
Yifan Hongdbaa4772019-07-03 11:40:08 -070028 libminui \
Yifan Hong10c2b402017-11-08 10:57:52 -080029 libvndksupport \
Sandeep Patilfca82442016-11-01 08:29:30 -070030 libhealthd_charger \
Tao Bao5747e222018-09-11 10:46:35 -070031 libhealthd_charger_nops \
Luke Song1d540dd2017-07-13 15:10:35 -070032 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070033 libbatterymonitor \
Tao Baof2455d82018-09-07 12:52:46 -070034
35CHARGER_SHARED_LIBRARIES := \
36 android.hardware.health@2.0 \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070037 libbase \
38 libcutils \
Suren Baghdasaryan82b72a52018-12-21 11:41:50 -080039 libjsoncpp \
Yifan Hongdbaa4772019-07-03 11:40:08 -070040 libpng \
Suren Baghdasaryan94910782019-01-25 05:32:52 +000041 libprocessgroup \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070042 liblog \
Tao Baof2455d82018-09-07 12:52:46 -070043 libutils \
Todd Poynorfea5b4d2013-09-09 12:09:08 -070044
Tao Bao5747e222018-09-11 10:46:35 -070045CHARGER_SHARED_LIBRARIES += libsuspend
Todd Poynorfea5b4d2013-09-09 12:09:08 -070046
Tao Bao5747e222018-09-11 10:46:35 -070047LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
48LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
49
Todd Poynord65104c2013-08-13 15:50:42 -070050LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -070051
Tao Baof2455d82018-09-07 12:52:46 -070052# Symlink /charger to /system/bin/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -070053LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
Tao Baof2455d82018-09-07 12:52:46 -070054 && ln -sf /system/bin/charger $(TARGET_ROOT_OUT)/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -070055
Todd Poynor752faf22013-06-12 13:25:59 -070056include $(BUILD_EXECUTABLE)
57
Tao Bao5747e222018-09-11 10:46:35 -070058### charger.recovery ###
59include $(CLEAR_VARS)
60
61LOCAL_SRC_FILES := \
62 charger.cpp \
63
64LOCAL_MODULE := charger.recovery
65LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
66LOCAL_MODULE_STEM := charger
67
68LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Yifan Hong97eecdc2019-07-03 11:07:37 -070069LOCAL_CFLAGS := -Wall -Werror -DCHARGER_FORCE_NO_UI=1
Tao Bao5747e222018-09-11 10:46:35 -070070
71# charger.recovery doesn't link against libhealthd_{charger,draw} or libminui, since it doesn't need
72# any UI support.
73LOCAL_STATIC_LIBRARIES := \
74 android.hardware.health@2.0-impl \
75 android.hardware.health@1.0-convert \
76 libbinderthreadstate \
Yifan Hong97eecdc2019-07-03 11:07:37 -070077 libcharger_sysprop \
Tao Bao5747e222018-09-11 10:46:35 -070078 libhidltransport \
79 libhidlbase \
80 libhwbinder_noltopgo \
81 libhealthstoragedefault \
82 libvndksupport \
83 libhealthd_charger_nops \
84 libbatterymonitor \
85
86# These shared libs will be installed to recovery image because of the dependency in `recovery`
87# module.
88LOCAL_SHARED_LIBRARIES := \
89 android.hardware.health@2.0 \
90 libbase \
91 libcutils \
92 liblog \
93 libutils \
94
95# The use of LOCAL_HAL_STATIC_LIBRARIES prevents from building this module with Android.bp.
96LOCAL_HAL_STATIC_LIBRARIES := libhealthd
97
98include $(BUILD_EXECUTABLE)
99
Tao Baof2455d82018-09-07 12:52:46 -0700100### charger_test ###
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800101include $(CLEAR_VARS)
102LOCAL_MODULE := charger_test
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800103LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Yifan Hong97eecdc2019-07-03 11:07:37 -0700104LOCAL_CFLAGS := -Wall -Werror
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800105LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
Tao Baof2455d82018-09-07 12:52:46 -0700106LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800107LOCAL_SRC_FILES := \
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800108 charger_test.cpp \
109
110include $(BUILD_EXECUTABLE)
111
112CHARGER_STATIC_LIBRARIES :=
Tao Baof2455d82018-09-07 12:52:46 -0700113CHARGER_SHARED_LIBRARIES :=
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800114
Tao Baof2455d82018-09-07 12:52:46 -0700115### charger_res_images ###
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800116ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700117define _add-charger-image
118include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700119LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700120LOCAL_MODULE_STEM := $(notdir $(1))
121_img_modules += $$(LOCAL_MODULE)
122LOCAL_SRC_FILES := $1
123LOCAL_MODULE_TAGS := optional
124LOCAL_MODULE_CLASS := ETC
125LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
126include $$(BUILD_PREBUILT)
127endef
128
129_img_modules :=
130_images :=
131$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
132 $(eval $(call _add-charger-image,$(_img))))
133
134include $(CLEAR_VARS)
135LOCAL_MODULE := charger_res_images
136LOCAL_MODULE_TAGS := optional
137LOCAL_REQUIRED_MODULES := $(_img_modules)
138include $(BUILD_PHONY_PACKAGE)
139
140_add-charger-image :=
141_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800142endif # LOCAL_CHARGER_NO_UI