2017-08-10 02:42:02 +02:00
LOCAL_PATH := $( call my-dir)
2017-10-10 10:47:53 +02:00
#####################################################################
# Create the list of vndk libraries from the source code.
INTERNAL_VNDK_LIB_LIST := $( call intermediates-dir-for,PACKAGING,vndk) /libs.txt
$(INTERNAL_VNDK_LIB_LIST) :
@echo " Generate: $@ "
@mkdir -p $( dir $@ )
$( hide) echo -n > $@
2018-04-12 05:25:12 +02:00
$( hide) $( foreach lib, $( filter-out libclang_rt.%,$( LLNDK_LIBRARIES) ) , \
2017-10-10 10:47:53 +02:00
echo LLNDK: $( lib) .so >> $@ ; )
$( hide) $( foreach lib, $( VNDK_SAMEPROCESS_LIBRARIES) , \
echo VNDK-SP: $( lib) .so >> $@ ; )
2018-04-12 05:25:12 +02:00
$( hide) $( foreach lib, $( filter-out libclang_rt.%,$( VNDK_CORE_LIBRARIES) ) , \
2017-10-10 10:47:53 +02:00
echo VNDK-core: $( lib) .so >> $@ ; )
$( hide) $( foreach lib, $( VNDK_PRIVATE_LIBRARIES) , \
echo VNDK-private: $( lib) .so >> $@ ; )
#####################################################################
# This is the up-to-date list of vndk libs.
# TODO(b/62012285): the lib list should be stored somewhere under
# /prebuilts/vndk
2018-04-10 10:59:44 +02:00
i f e q ( R E L , $( PLATFORM_VERSION_CODENAME ) )
2017-10-10 10:47:53 +02:00
LATEST_VNDK_LIB_LIST := $( LOCAL_PATH) /$( PLATFORM_VNDK_VERSION) .txt
2018-04-10 10:59:44 +02:00
i f e q ( $( wildcard $ ( LATEST_VNDK_LIB_LIST ) ) , )
$( error $ ( LATEST_VNDK_LIB_LIST ) file not found . Please copy "$ ( LOCAL_PATH ) /current .txt " to "$ ( LATEST_VNDK_LIB_LIST ) " and commit a CL for release branch )
e n d i f
e l s e
LATEST_VNDK_LIB_LIST := $( LOCAL_PATH) /current.txt
e n d i f
2017-10-10 10:47:53 +02:00
#####################################################################
# Check the generate list against the latest list stored in the
# source tree
.PHONY : check -vndk -list
2018-04-10 10:59:44 +02:00
# Check if vndk list is changed
2017-10-10 10:47:53 +02:00
droidcore : check -vndk -list
check-vndk-list-timestamp := $( call intermediates-dir-for,PACKAGING,vndk) /check-list-timestamp
2019-07-18 07:36:50 +02:00
check-vndk-abi-dump-list-timestamp := $( call intermediates-dir-for,PACKAGING,vndk) /check-abi-dump-list-timestamp
2018-06-22 05:18:28 +02:00
i f e q ( $( TARGET_IS_ 64_BIT ) | $( TARGET_ 2ND_ARCH ) , t r u e | )
# TODO(b/110429754) remove this condition when we support 64-bit-only device
check-vndk-list : ;
2018-11-01 02:32:58 +01:00
e l s e i f e q ( $( TARGET_BUILD_PDK ) , t r u e )
# b/118634643: don't check VNDK lib list when building PDK. Some libs (libandroid_net.so
# and some render-script related ones) can't be built in PDK due to missing frameworks/base.
check-vndk-list : ;
2019-05-14 09:44:52 +02:00
e l s e i f e q ( $( TARGET_SKIP_CURRENT_VNDK ) , t r u e )
check-vndk-list : ;
2018-06-22 05:18:28 +02:00
e l s e
2017-10-10 10:47:53 +02:00
check-vndk-list : $( check -vndk -list -timestamp )
2019-07-18 07:36:50 +02:00
i f n e q ( $( SKIP_ABI_CHECKS ) , t r u e )
check-vndk-list : $( check -vndk -abi -dump -list -timestamp )
e n d i f
2018-06-22 05:18:28 +02:00
e n d i f
2017-10-10 10:47:53 +02:00
2018-04-10 10:59:44 +02:00
_vndk_check_failure_message := " error: VNDK library list has been changed.\n"
i f e q ( R E L , $( PLATFORM_VERSION_CODENAME ) )
_vndk_check_failure_message += " Changing the VNDK library list is not allowed in API locked branches."
2017-10-10 10:47:53 +02:00
e l s e
2018-04-10 10:59:44 +02:00
_vndk_check_failure_message += " Run update-vndk-list.sh to update $( LATEST_VNDK_LIB_LIST) "
2017-10-10 10:47:53 +02:00
e n d i f
$(check-vndk-list-timestamp) : $( INTERNAL_VNDK_LIB_LIST ) $( LATEST_VNDK_LIB_LIST ) $( HOST_OUT_EXECUTABLES ) /update -vndk -list .sh
$( hide) ( diff --old-line-format= "Removed %L" \
--new-line-format= "Added %L" \
--unchanged-line-format= "" \
$( LATEST_VNDK_LIB_LIST) $( INTERNAL_VNDK_LIB_LIST) \
2018-04-10 10:59:44 +02:00
|| ( echo -e $( _vndk_check_failure_message) ; exit 1 ) )
2017-10-10 10:47:53 +02:00
$( hide) mkdir -p $( dir $@ )
$( hide) touch $@
#####################################################################
# Script to update the latest VNDK lib list
2017-08-10 02:42:02 +02:00
i n c l u d e $( CLEAR_VARS )
2017-10-10 10:47:53 +02:00
LOCAL_MODULE := update-vndk-list.sh
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE_STEM := $( LOCAL_MODULE)
LOCAL_IS_HOST_MODULE := true
i n c l u d e $( BUILD_SYSTEM ) / b a s e _ r u l e s . m k
$(LOCAL_BUILT_MODULE) : PRIVATE_INTERNAL_VNDK_LIB_LIST := $( INTERNAL_VNDK_LIB_LIST )
$(LOCAL_BUILT_MODULE) : PRIVATE_LATEST_VNDK_LIB_LIST := $( LATEST_VNDK_LIB_LIST )
$(LOCAL_BUILT_MODULE) :
@echo " Generate: $@ "
@mkdir -p $( dir $@ )
@rm -f $@
$( hide) echo "#!/bin/bash" > $@
i f e q ( R E L , $( PLATFORM_VERSION_CODENAME ) )
$( hide) echo "echo Updating VNDK library list is NOT allowed in API locked branches." >> $@ ; \
echo "exit 1" >> $@
e l s e
2018-04-10 10:59:44 +02:00
$( hide) echo " if [ -z \"\$ ${ ANDROID_BUILD_TOP } \" ]; then " >> $@ ; \
echo " echo Run lunch or choosecombo first" >> $@ ; \
echo " exit 1" >> $@ ; \
echo "fi" >> $@ ; \
echo " cd \$ ${ ANDROID_BUILD_TOP } " >> $@ ; \
echo " cp $( PRIVATE_INTERNAL_VNDK_LIB_LIST) $( PRIVATE_LATEST_VNDK_LIB_LIST) " >> $@ ; \
2017-10-10 10:47:53 +02:00
echo " echo $( PRIVATE_LATEST_VNDK_LIB_LIST) updated. " >> $@
e n d i f
@chmod a+x $@
2017-08-10 02:42:02 +02:00
2019-07-18 07:36:50 +02:00
#####################################################################
# Check that all ABI reference dumps have corresponding NDK/VNDK
# libraries.
# $(1): The directory containing ABI dumps.
# Return a list of ABI dump paths ending with .so.lsdump.
d e f i n e f i n d - a b i - d u m p - p a t h s
$( if $ ( wildcard $ ( 1) ) , \
$( addprefix $( 1) /, \
$( call find-files-in-subdirs,$( 1) ,"*.so.lsdump" -and -type f,.) ) )
e n d e f
VNDK_ABI_DUMP_DIR := prebuilts/abi-dumps/vndk/$( PLATFORM_VNDK_VERSION)
NDK_ABI_DUMP_DIR := prebuilts/abi-dumps/ndk/$( PLATFORM_VNDK_VERSION)
VNDK_ABI_DUMPS := $( call find-abi-dump-paths,$( VNDK_ABI_DUMP_DIR) )
NDK_ABI_DUMPS := $( call find-abi-dump-paths,$( NDK_ABI_DUMP_DIR) )
$(check-vndk-abi-dump-list-timestamp) : $( VNDK_ABI_DUMPS ) $( NDK_ABI_DUMPS )
$( eval added_vndk_abi_dumps := $( strip $( sort $( filter-out \
2019-07-31 11:36:05 +02:00
$( addsuffix .so.lsdump,$( filter-out $( NDK_MIGRATED_LIBS) $( VNDK_PRIVATE_LIBRARIES) ,$( LLNDK_LIBRARIES) $( VNDK_SAMEPROCESS_LIBRARIES) $( VNDK_CORE_LIBRARIES) ) ) , \
2019-07-18 07:36:50 +02:00
$( notdir $( VNDK_ABI_DUMPS) ) ) ) ) )
$( if $( added_vndk_abi_dumps) , \
echo -e " Found ABI reference dumps for non-VNDK libraries. Run \`find \$ ${ ANDROID_BUILD_TOP } / $( VNDK_ABI_DUMP_DIR) '(' -name $( subst $( space) , -or -name ,$( added_vndk_abi_dumps) ) ')' -delete\` to delete the dumps. " )
$( eval added_ndk_abi_dumps := $( strip $( sort $( filter-out \
2019-07-31 11:36:05 +02:00
$( addsuffix .so.lsdump,$( NDK_MIGRATED_LIBS) ) , \
2019-07-18 07:36:50 +02:00
$( notdir $( NDK_ABI_DUMPS) ) ) ) ) )
$( if $( added_ndk_abi_dumps) , \
echo -e " Found ABI reference dumps for non-NDK libraries. Run \`find \$ ${ ANDROID_BUILD_TOP } / $( NDK_ABI_DUMP_DIR) '(' -name $( subst $( space) , -or -name ,$( added_ndk_abi_dumps) ) ')' -delete\` to delete the dumps. " )
$( if $( added_vndk_abi_dumps) $( added_ndk_abi_dumps) ,exit 1)
$( hide) mkdir -p $( dir $@ )
$( hide) touch $@
#####################################################################
# VNDK package and snapshot.
2018-06-21 07:18:54 +02:00
i f n e q ( $( BOARD_VNDK_VERSION ) , )
2017-10-10 10:47:53 +02:00
i n c l u d e $( CLEAR_VARS )
2018-01-05 10:35:06 +01:00
LOCAL_MODULE := vndk_package
2019-07-12 15:04:43 +02:00
# Filter LLNDK libs moved to APEX to avoid pulling them into /system/LIB
2017-08-10 02:42:02 +02:00
LOCAL_REQUIRED_MODULES := \
2019-08-29 20:17:16 +02:00
$( filter-out $( LLNDK_MOVED_TO_APEX_LIBRARIES) ,$( LLNDK_LIBRARIES) )
2019-07-12 15:04:43 +02:00
2019-02-13 02:46:10 +01:00
i f n e q ( $( TARGET_SKIP_CURRENT_VNDK ) , t r u e )
LOCAL_REQUIRED_MODULES += \
2019-05-14 09:44:52 +02:00
llndk.libraries.txt \
vndksp.libraries.txt \
2019-02-13 02:46:10 +01:00
$( addsuffix .vendor,$( VNDK_CORE_LIBRARIES) ) \
$( addsuffix .vendor,$( VNDK_SAMEPROCESS_LIBRARIES) )
e n d i f
2017-08-10 02:42:02 +02:00
i n c l u d e $( BUILD_PHONY_PACKAGE )
2017-11-17 08:09:17 +01:00
i n c l u d e $( CLEAR_VARS )
2018-01-05 10:35:06 +01:00
LOCAL_MODULE := vndk_snapshot_package
2018-06-08 07:48:39 +02:00
_binder32 :=
i f n e q ( $( TARGET_USES_ 64_BIT_BINDER ) , t r u e )
i f n e q ( $( TARGET_IS_ 64_BIT ) , t r u e )
_binder32 := _binder32
e n d i f
e n d i f
2017-11-17 08:09:17 +01:00
LOCAL_REQUIRED_MODULES := \
2018-06-08 07:48:39 +02:00
$( foreach vndk_ver,$( PRODUCT_EXTRA_VNDK_VERSIONS) ,vndk_v$( vndk_ver) _$( TARGET_ARCH) $( _binder32) )
_binder32 :=
2017-11-17 08:09:17 +01:00
i n c l u d e $( BUILD_PHONY_PACKAGE )
2018-01-05 10:35:06 +01:00
2017-10-10 10:47:53 +02:00
e n d i f # BOARD_VNDK_VERSION is set