blob: 66ff39935b23443694f2b3087bb743514afe24fe [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 libhidlbase \
Hridya Valsaraju89178e72018-01-10 16:14:28 -080025 libhealthstoragedefault \
Yifan Hongdbaa4772019-07-03 11:40:08 -070026 libminui \
Yifan Hong10c2b402017-11-08 10:57:52 -080027 libvndksupport \
Sandeep Patilfca82442016-11-01 08:29:30 -070028 libhealthd_charger \
Tao Bao5747e222018-09-11 10:46:35 -070029 libhealthd_charger_nops \
Luke Song1d540dd2017-07-13 15:10:35 -070030 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070031 libbatterymonitor \
Tao Baof2455d82018-09-07 12:52:46 -070032
33CHARGER_SHARED_LIBRARIES := \
34 android.hardware.health@2.0 \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070035 libbase \
36 libcutils \
Suren Baghdasaryan82b72a52018-12-21 11:41:50 -080037 libjsoncpp \
Yifan Hongdbaa4772019-07-03 11:40:08 -070038 libpng \
Suren Baghdasaryan94910782019-01-25 05:32:52 +000039 libprocessgroup \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070040 liblog \
Tao Baof2455d82018-09-07 12:52:46 -070041 libutils \
Todd Poynorfea5b4d2013-09-09 12:09:08 -070042
Tao Bao5747e222018-09-11 10:46:35 -070043CHARGER_SHARED_LIBRARIES += libsuspend
Todd Poynorfea5b4d2013-09-09 12:09:08 -070044
Tao Bao5747e222018-09-11 10:46:35 -070045LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
46LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
47
Todd Poynord65104c2013-08-13 15:50:42 -070048LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -070049
Tao Baof2455d82018-09-07 12:52:46 -070050# Symlink /charger to /system/bin/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -070051LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
Tao Baof2455d82018-09-07 12:52:46 -070052 && ln -sf /system/bin/charger $(TARGET_ROOT_OUT)/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -070053
Todd Poynor752faf22013-06-12 13:25:59 -070054include $(BUILD_EXECUTABLE)
55
Tao Bao5747e222018-09-11 10:46:35 -070056### charger.recovery ###
57include $(CLEAR_VARS)
58
59LOCAL_SRC_FILES := \
60 charger.cpp \
61
62LOCAL_MODULE := charger.recovery
63LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
64LOCAL_MODULE_STEM := charger
65
66LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Yifan Hong97eecdc2019-07-03 11:07:37 -070067LOCAL_CFLAGS := -Wall -Werror -DCHARGER_FORCE_NO_UI=1
Tao Bao5747e222018-09-11 10:46:35 -070068
69# charger.recovery doesn't link against libhealthd_{charger,draw} or libminui, since it doesn't need
70# any UI support.
71LOCAL_STATIC_LIBRARIES := \
72 android.hardware.health@2.0-impl \
73 android.hardware.health@1.0-convert \
74 libbinderthreadstate \
Yifan Hong97eecdc2019-07-03 11:07:37 -070075 libcharger_sysprop \
Tao Bao5747e222018-09-11 10:46:35 -070076 libhidlbase \
Tao Bao5747e222018-09-11 10:46:35 -070077 libhealthstoragedefault \
78 libvndksupport \
79 libhealthd_charger_nops \
80 libbatterymonitor \
81
82# These shared libs will be installed to recovery image because of the dependency in `recovery`
83# module.
84LOCAL_SHARED_LIBRARIES := \
85 android.hardware.health@2.0 \
86 libbase \
87 libcutils \
88 liblog \
89 libutils \
90
91# The use of LOCAL_HAL_STATIC_LIBRARIES prevents from building this module with Android.bp.
92LOCAL_HAL_STATIC_LIBRARIES := libhealthd
93
94include $(BUILD_EXECUTABLE)
95
Tao Baof2455d82018-09-07 12:52:46 -070096### charger_test ###
Yifan Hongb7cd45f2017-11-13 18:47:03 -080097include $(CLEAR_VARS)
98LOCAL_MODULE := charger_test
Yifan Hongb7cd45f2017-11-13 18:47:03 -080099LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Yifan Hong97eecdc2019-07-03 11:07:37 -0700100LOCAL_CFLAGS := -Wall -Werror
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800101LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
Tao Baof2455d82018-09-07 12:52:46 -0700102LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800103LOCAL_SRC_FILES := \
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800104 charger_test.cpp \
105
106include $(BUILD_EXECUTABLE)
107
108CHARGER_STATIC_LIBRARIES :=
Tao Baof2455d82018-09-07 12:52:46 -0700109CHARGER_SHARED_LIBRARIES :=
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800110
Tao Baof2455d82018-09-07 12:52:46 -0700111### charger_res_images ###
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800112ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700113define _add-charger-image
114include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700115LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700116LOCAL_MODULE_STEM := $(notdir $(1))
117_img_modules += $$(LOCAL_MODULE)
118LOCAL_SRC_FILES := $1
119LOCAL_MODULE_TAGS := optional
120LOCAL_MODULE_CLASS := ETC
121LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
122include $$(BUILD_PREBUILT)
123endef
124
125_img_modules :=
126_images :=
127$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
128 $(eval $(call _add-charger-image,$(_img))))
129
130include $(CLEAR_VARS)
131LOCAL_MODULE := charger_res_images
132LOCAL_MODULE_TAGS := optional
133LOCAL_REQUIRED_MODULES := $(_img_modules)
134include $(BUILD_PHONY_PACKAGE)
135
136_add-charger-image :=
137_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800138endif # LOCAL_CHARGER_NO_UI