blob: 78d60dfd188e3ea35dec8ef8afd425fc5b30de74 [file] [log] [blame]
San Mehatf1b736b2009-10-10 17:22:08 -07001LOCAL_PATH:= $(call my-dir)
2
Kenny Rootacc9e7d2010-06-18 19:06:50 -07003common_src_files := \
4 VolumeManager.cpp \
5 CommandListener.cpp \
Paul Lawrenced0b42952015-06-03 14:19:51 -07006 CryptCommandListener.cpp \
Kenny Rootacc9e7d2010-06-18 19:06:50 -07007 VoldCommand.cpp \
8 NetlinkManager.cpp \
9 NetlinkHandler.cpp \
Kenny Rootacc9e7d2010-06-18 19:06:50 -070010 Process.cpp \
Jeff Sharkeyd0640f62015-05-21 22:35:42 -070011 fs/Ext4.cpp \
12 fs/F2fs.cpp \
13 fs/Vfat.cpp \
Kenny Rootacc9e7d2010-06-18 19:06:50 -070014 Loop.cpp \
15 Devmapper.cpp \
16 ResponseCode.cpp \
Paul Lawrence87999172014-02-20 12:21:31 -080017 CheckBattery.cpp \
Paul Lawrence707fd6c2015-04-28 22:14:15 +000018 Ext4Crypt.cpp \
Ken Sumrall9caab762013-06-11 19:10:20 -070019 VoldUtil.c \
Wei Wang4375f1b2017-02-24 17:43:01 -080020 cryptfs.cpp \
Jeff Sharkey11c2d382017-09-11 10:32:01 -060021 model/Disk.cpp \
22 model/VolumeBase.cpp \
23 model/PublicVolume.cpp \
24 model/PrivateVolume.cpp \
25 model/EmulatedVolume.cpp \
26 model/ObbVolume.cpp \
Jeff Sharkeydeb24052015-03-02 21:01:40 -080027 Utils.cpp \
Jeff Sharkey1d6fbcc2015-04-24 16:00:03 -070028 MoveTask.cpp \
Jeff Sharkey52f7a912017-09-15 12:57:44 -060029 BenchmarkTask.cpp \
Jeff Sharkeyc86ab6f2015-06-26 14:02:09 -070030 TrimTask.cpp \
Pavel Grafove2e2d302017-08-01 17:15:53 +010031 KeyBuffer.cpp \
Paul Crowley1ef25582016-01-21 20:26:12 +000032 Keymaster.cpp \
33 KeyStorage.cpp \
Paul Crowleyf71ace32016-06-02 11:01:19 -070034 KeyUtil.cpp \
Paul Crowley63c18d32016-02-10 14:02:47 +000035 ScryptParameters.cpp \
Jeff Vander Stoepdf725752016-01-29 15:34:43 -080036 secontext.cpp \
Paul Crowleyf71ace32016-06-02 11:01:19 -070037 EncryptInplace.cpp \
Paul Crowleyd5759812016-06-02 11:04:27 -070038 MetadataCrypt.cpp \
Jeff Sharkey52f7a912017-09-15 12:57:44 -060039 VoldNativeService.cpp \
40
41common_aidl_files := \
Jeff Sharkey068c6be2017-09-06 13:47:40 -060042 binder/android/os/IVold.aidl \
Jeff Sharkey814e9d32017-09-13 11:49:44 -060043 binder/android/os/IVoldListener.aidl \
Jeff Sharkey52f7a912017-09-15 12:57:44 -060044 binder/android/os/IVoldTaskListener.aidl \
45
46common_aidl_includes := \
47 $(LOCAL_PATH)/binder \
48 frameworks/native/aidl/binder \
Kenny Rootacc9e7d2010-06-18 19:06:50 -070049
50common_c_includes := \
Daniel Rosenberge82df162014-08-15 22:19:23 +000051 system/extras/f2fs_utils \
Paul Lawrence87999172014-02-20 12:21:31 -080052 external/scrypt/lib/crypto \
Paul Crowleyf71ace32016-06-02 11:01:19 -070053 external/f2fs-tools/include \
Paul Lawrence69f4ebd2014-04-14 12:17:14 -070054 frameworks/native/include \
55 system/security/keystore \
Kenny Rootacc9e7d2010-06-18 19:06:50 -070056
57common_shared_libraries := \
58 libsysutils \
Paul Lawrence87999172014-02-20 12:21:31 -080059 libbinder \
Kenny Rootacc9e7d2010-06-18 19:06:50 -070060 libcutils \
Elliott Hughesc3bda182017-05-09 17:01:04 -070061 libkeyutils \
Ying Wang741a1692013-04-09 22:05:28 -070062 liblog \
Kenny Rootacc9e7d2010-06-18 19:06:50 -070063 libdiskconfig \
Ken Sumrall5d4c68e2011-01-30 19:06:03 -080064 libhardware_legacy \
Rom Lemarchand2ba45aa2013-01-16 12:29:28 -080065 liblogwrap \
Ken Sumrall5cf759a2013-08-14 20:15:17 -070066 libext4_utils \
Daniel Rosenberge82df162014-08-15 22:19:23 +000067 libf2fs_sparseblock \
Mattias Nisslerdc803232016-03-31 16:32:59 +020068 libcrypto_utils \
Robert Craigb9e3ba52014-02-04 10:53:00 -050069 libcrypto \
Paul Lawrence87999172014-02-20 12:21:31 -080070 libselinux \
Paul Lawrence69f4ebd2014-04-14 12:17:14 -070071 libutils \
72 libhardware \
Paul Crowley1ef25582016-01-21 20:26:12 +000073 libbase \
Janis Danisevskis8e537b82016-10-26 14:27:10 +010074 libhwbinder \
75 libhidlbase \
76 android.hardware.keymaster@3.0 \
77 libkeystore_binder
Kenny Rootacc9e7d2010-06-18 19:06:50 -070078
Kenny Rootc4c70f12013-06-14 12:11:38 -070079common_static_libraries := \
Yabin Cui1fb59662016-06-24 14:48:49 -070080 libbootloader_message \
Kenny Rootc4c70f12013-06-14 12:11:38 -070081 libfs_mgr \
Sami Tolvanenefe67cd2015-06-01 15:38:29 +010082 libfec \
83 libfec_rs \
Mohamad Ayyashc489d7f2015-04-06 18:15:53 -070084 libsquashfs_utils \
Geremy Condrac49f0f22013-08-07 13:12:41 -070085 libscrypt_static \
Paul Crowley1ef25582016-01-21 20:26:12 +000086 libbatteryservice \
bowgotsai58bdac82017-01-07 00:44:35 +080087 libavb \
Kenny Rootc4c70f12013-06-14 12:11:38 -070088
Jeff Sharkey32ebb732017-03-27 16:18:50 -060089# TODO: include "cert-err34-c" once we move to Binder
90# TODO: include "cert-err58-cpp" once 36656327 is fixed
Jeff Sharkey83b559c2017-09-12 16:30:52 -060091common_local_tidy_enabled := true
Jeff Sharkey32ebb732017-03-27 16:18:50 -060092common_local_tidy_flags := -warnings-as-errors=clang-analyzer-security*,cert-*
93common_local_tidy_checks := -*,clang-analyzer-security*,cert-*,-cert-err34-c,-cert-err58-cpp
94
Dan Albertc07fa3f2014-12-18 10:00:55 -080095vold_conlyflags := -std=c11
Jeff Sharkeydeb24052015-03-02 21:01:40 -080096vold_cflags := -Werror -Wall -Wno-missing-field-initializers -Wno-unused-variable -Wno-unused-parameter
Dan Albertc07fa3f2014-12-18 10:00:55 -080097
Adrien Schildknechte0f409c2016-11-21 15:14:37 -080098required_modules :=
99ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
Jin Qianb678d7c2017-08-15 16:44:04 -0700100 required_modules += mke2fs
Adrien Schildknechte0f409c2016-11-21 15:14:37 -0800101endif
102
San Mehatf1b736b2009-10-10 17:22:08 -0700103include $(CLEAR_VARS)
104
Dan Albertb2aaf3a2014-09-12 10:48:12 -0700105LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Kenny Rootacc9e7d2010-06-18 19:06:50 -0700106LOCAL_MODULE := libvold
Dan Albertc07fa3f2014-12-18 10:00:55 -0800107LOCAL_CLANG := true
Jeff Sharkey83b559c2017-09-12 16:30:52 -0600108LOCAL_TIDY := $(common_local_tidy_enabled)
Jeff Sharkey32ebb732017-03-27 16:18:50 -0600109LOCAL_TIDY_FLAGS := $(common_local_tidy_flags)
110LOCAL_TIDY_CHECKS := $(common_local_tidy_checks)
Jeff Sharkey52f7a912017-09-15 12:57:44 -0600111LOCAL_SRC_FILES := $(common_src_files) $(common_aidl_files)
Kenny Rootacc9e7d2010-06-18 19:06:50 -0700112LOCAL_C_INCLUDES := $(common_c_includes)
Kenny Rootacc9e7d2010-06-18 19:06:50 -0700113LOCAL_SHARED_LIBRARIES := $(common_shared_libraries)
Kenny Rootc4c70f12013-06-14 12:11:38 -0700114LOCAL_STATIC_LIBRARIES := $(common_static_libraries)
Kenny Rootacc9e7d2010-06-18 19:06:50 -0700115LOCAL_MODULE_TAGS := eng tests
Dan Albertc07fa3f2014-12-18 10:00:55 -0800116LOCAL_CFLAGS := $(vold_cflags)
117LOCAL_CONLYFLAGS := $(vold_conlyflags)
Adrien Schildknechte0f409c2016-11-21 15:14:37 -0800118LOCAL_REQUIRED_MODULES := $(required_modules)
Kenny Rootacc9e7d2010-06-18 19:06:50 -0700119
Jeff Sharkey52f7a912017-09-15 12:57:44 -0600120LOCAL_AIDL_INCLUDES := $(common_aidl_includes)
Jeff Sharkey814e9d32017-09-13 11:49:44 -0600121
Kenny Rootacc9e7d2010-06-18 19:06:50 -0700122include $(BUILD_STATIC_LIBRARY)
123
124include $(CLEAR_VARS)
San Mehatf1b736b2009-10-10 17:22:08 -0700125
Dan Albertb2aaf3a2014-09-12 10:48:12 -0700126LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Jeff Sharkey47695b22016-02-01 17:02:29 -0700127LOCAL_MODULE := vold
Dan Albertc07fa3f2014-12-18 10:00:55 -0800128LOCAL_CLANG := true
Jeff Sharkey83b559c2017-09-12 16:30:52 -0600129LOCAL_TIDY := $(common_local_tidy_enabled)
Jeff Sharkey32ebb732017-03-27 16:18:50 -0600130LOCAL_TIDY_FLAGS := $(common_local_tidy_flags)
131LOCAL_TIDY_CHECKS := $(common_local_tidy_checks)
Kenny Rootacc9e7d2010-06-18 19:06:50 -0700132LOCAL_SRC_FILES := \
133 main.cpp \
Jeff Sharkey52f7a912017-09-15 12:57:44 -0600134 $(common_src_files) \
135 $(common_aidl_files) \
Kenny Rootacc9e7d2010-06-18 19:06:50 -0700136
Tom Cherrya2859842015-08-14 13:06:45 -0700137LOCAL_INIT_RC := vold.rc
138
Kenny Rootacc9e7d2010-06-18 19:06:50 -0700139LOCAL_C_INCLUDES := $(common_c_includes)
Dan Albertc07fa3f2014-12-18 10:00:55 -0800140LOCAL_CFLAGS := $(vold_cflags)
141LOCAL_CONLYFLAGS := $(vold_conlyflags)
San Mehatf1b736b2009-10-10 17:22:08 -0700142
Kenny Rootacc9e7d2010-06-18 19:06:50 -0700143LOCAL_SHARED_LIBRARIES := $(common_shared_libraries)
Kenny Rootc4c70f12013-06-14 12:11:38 -0700144LOCAL_STATIC_LIBRARIES := $(common_static_libraries)
Adrien Schildknechte0f409c2016-11-21 15:14:37 -0800145LOCAL_REQUIRED_MODULES := $(required_modules)
Ken Sumrallf0679f02012-04-01 23:58:44 -0700146
Jeff Sharkey52f7a912017-09-15 12:57:44 -0600147LOCAL_AIDL_INCLUDES := $(common_aidl_includes)
Jeff Sharkey068c6be2017-09-06 13:47:40 -0600148
San Mehatf1b736b2009-10-10 17:22:08 -0700149include $(BUILD_EXECUTABLE)
150
151include $(CLEAR_VARS)
Kenny Root7b18a7b2010-03-15 13:13:41 -0700152
Dan Albertb2aaf3a2014-09-12 10:48:12 -0700153LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Dan Albertc07fa3f2014-12-18 10:00:55 -0800154LOCAL_CLANG := true
Jeff Sharkey83b559c2017-09-12 16:30:52 -0600155LOCAL_TIDY := $(common_local_tidy_enabled)
Jeff Sharkey32ebb732017-03-27 16:18:50 -0600156LOCAL_TIDY_FLAGS := $(common_local_tidy_flags)
157LOCAL_TIDY_CHECKS := $(common_local_tidy_checks)
Jeff Sharkey0990b692017-09-14 17:24:26 -0600158
159LOCAL_SRC_FILES := \
160 vdc.cpp \
Jeff Sharkey52f7a912017-09-15 12:57:44 -0600161 $(common_aidl_files) \
Jeff Sharkey0990b692017-09-14 17:24:26 -0600162
Jeff Sharkey47695b22016-02-01 17:02:29 -0700163LOCAL_MODULE := vdc
Jeff Sharkey99f92682017-09-13 18:43:44 -0600164LOCAL_SHARED_LIBRARIES := libbase libbinder libcutils libutils
Dan Albertc07fa3f2014-12-18 10:00:55 -0800165LOCAL_CFLAGS := $(vold_cflags)
166LOCAL_CONLYFLAGS := $(vold_conlyflags)
Tom Cherrya2859842015-08-14 13:06:45 -0700167LOCAL_INIT_RC := vdc.rc
San Mehatf1b736b2009-10-10 17:22:08 -0700168
Jeff Sharkey52f7a912017-09-15 12:57:44 -0600169LOCAL_AIDL_INCLUDES := $(common_aidl_includes)
Jeff Sharkey99f92682017-09-13 18:43:44 -0600170
San Mehatf1b736b2009-10-10 17:22:08 -0700171include $(BUILD_EXECUTABLE)
Paul Crowley5bd0daf2015-05-19 17:31:39 +0100172
173include $(CLEAR_VARS)
174
175LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
176LOCAL_CLANG := true
Jeff Sharkey83b559c2017-09-12 16:30:52 -0600177LOCAL_TIDY := $(common_local_tidy_enabled)
Jeff Sharkey32ebb732017-03-27 16:18:50 -0600178LOCAL_TIDY_FLAGS := $(common_local_tidy_flags)
179LOCAL_TIDY_CHECKS := $(common_local_tidy_checks)
Paul Crowley03f89d32017-06-16 09:37:31 -0700180LOCAL_SRC_FILES:= \
181 FileDeviceUtils.cpp \
182 secdiscard.cpp \
183
Paul Crowley5bd0daf2015-05-19 17:31:39 +0100184LOCAL_MODULE:= secdiscard
Paul Crowley8bb8fcf2016-01-11 12:26:44 +0000185LOCAL_SHARED_LIBRARIES := libbase
Paul Crowley5bd0daf2015-05-19 17:31:39 +0100186LOCAL_CFLAGS := $(vold_cflags)
187LOCAL_CONLYFLAGS := $(vold_conlyflags)
188
189include $(BUILD_EXECUTABLE)
Paul Crowley4315c6a2016-12-06 08:22:04 -0800190
191include $(LOCAL_PATH)/tests/Android.mk