@ -250,7 +250,7 @@ function truncate_file() {
#
#
# write_product_copy_files:
# write_product_copy_files:
#
#
# $1: make treble compatible makefile - optional , default to fals e
# $1: make treble compatible makefile - optional and deprecated, default to tru e
#
#
# Creates the PRODUCT_COPY_FILES section in the product makefile for all
# Creates the PRODUCT_COPY_FILES section in the product makefile for all
# items in the list which do not start with a dash (-).
# items in the list which do not start with a dash (-).
@ -275,7 +275,6 @@ function write_product_copy_files() {
fi
fi
TARGET = $( target_file " $FILE " )
TARGET = $( target_file " $FILE " )
if [ " $TREBLE_COMPAT " = = "true" ] || [ " $TREBLE_COMPAT " = = "1" ] ; then
if prefix_match_file "vendor/" $TARGET ; then
if prefix_match_file "vendor/" $TARGET ; then
local OUTTARGET = $( truncate_file $TARGET )
local OUTTARGET = $( truncate_file $TARGET )
printf ' %s/proprietary/%s:$(TARGET_COPY_OUT_VENDOR)/%s%s\n' \
printf ' %s/proprietary/%s:$(TARGET_COPY_OUT_VENDOR)/%s%s\n' \
@ -288,12 +287,12 @@ function write_product_copy_files() {
local OUTTARGET = $( truncate_file $TARGET )
local OUTTARGET = $( truncate_file $TARGET )
printf ' %s/proprietary/%s:$(TARGET_COPY_OUT_ODM)/%s%s\n' \
printf ' %s/proprietary/%s:$(TARGET_COPY_OUT_ODM)/%s%s\n' \
" $OUTDIR " " $TARGET " " $OUTTARGET " " $LINEEND " >> " $PRODUCTMK "
" $OUTDIR " " $TARGET " " $OUTTARGET " " $LINEEND " >> " $PRODUCTMK "
elif prefix_match_file "system/" $TARGET ; then
local OUTTARGET = $( truncate_file $TARGET )
printf ' %s/proprietary/%s:$(TARGET_COPY_OUT_SYSTEM)/%s%s\n' \
" $OUTDIR " " $TARGET " " $OUTTARGET " " $LINEEND " >> " $PRODUCTMK "
else
else
printf ' %s/proprietary/%s:system/%s%s\n' \
printf ' %s/proprietary/%s:$(TARGET_COPY_OUT_SYSTEM)/%s%s\n' \
" $OUTDIR " " $TARGET " " $TARGET " " $LINEEND " >> " $PRODUCTMK "
fi
else
printf ' %s/proprietary/%s:system/%s%s\n' \
" $OUTDIR " " $TARGET " " $TARGET " " $LINEEND " >> " $PRODUCTMK "
" $OUTDIR " " $TARGET " " $TARGET " " $LINEEND " >> " $PRODUCTMK "
fi
fi
done
done
@ -304,7 +303,7 @@ function write_product_copy_files() {
# write_packages:
# write_packages:
#
#
# $1: The LOCAL_MODULE_CLASS for the given module list
# $1: The LOCAL_MODULE_CLASS for the given module list
# $2: / odm, /product, or /vendor partition
# $2: / system, / odm, /product, or /vendor partition
# $3: type-specific extra flags
# $3: type-specific extra flags
# $4: Name of the array holding the target list
# $4: Name of the array holding the target list
#
#
@ -342,7 +341,9 @@ function write_packages() {
PACKAGE_LIST += ( " $PKGNAME " )
PACKAGE_LIST += ( " $PKGNAME " )
SRC = "proprietary"
SRC = "proprietary"
if [ " $PARTITION " = "vendor" ] ; then
if [ " $PARTITION " = "system" ] ; then
SRC += "/system"
elif [ " $PARTITION " = "vendor" ] ; then
SRC += "/vendor"
SRC += "/vendor"
elif [ " $PARTITION " = "product" ] ; then
elif [ " $PARTITION " = "product" ] ; then
SRC += "/product"
SRC += "/product"
@ -471,6 +472,22 @@ function write_product_packages() {
write_packages "SHARED_LIBRARIES" "" "64" "LIB64" >> " $ANDROIDMK "
write_packages "SHARED_LIBRARIES" "" "64" "LIB64" >> " $ANDROIDMK "
fi
fi
local T_S_LIB32 = ( $( prefix_match "system/lib/" ) )
local T_S_LIB64 = ( $( prefix_match "system/lib64/" ) )
local S_MULTILIBS = ( $( comm -12 <( printf '%s\n' " ${ T_S_LIB32 [@] } " ) <( printf '%s\n' " ${ T_S_LIB64 [@] } " ) ) )
local S_LIB32 = ( $( comm -23 <( printf '%s\n' " ${ T_S_LIB32 [@] } " ) <( printf '%s\n' " ${ S_MULTILIBS [@] } " ) ) )
local S_LIB64 = ( $( comm -23 <( printf '%s\n' " ${ T_S_LIB64 [@] } " ) <( printf '%s\n' " ${ S_MULTILIBS [@] } " ) ) )
if [ " ${# S_MULTILIBS [@] } " -gt "0" ] ; then
write_packages "SHARED_LIBRARIES" "system" "both" "S_MULTILIBS" >> " $ANDROIDMK "
fi
if [ " ${# S_LIB32 [@] } " -gt "0" ] ; then
write_packages "SHARED_LIBRARIES" "system" "32" "S_LIB32" >> " $ANDROIDMK "
fi
if [ " ${# S_LIB64 [@] } " -gt "0" ] ; then
write_packages "SHARED_LIBRARIES" "system" "64" "S_LIB64" >> " $ANDROIDMK "
fi
local T_V_LIB32 = ( $( prefix_match "vendor/lib/" ) )
local T_V_LIB32 = ( $( prefix_match "vendor/lib/" ) )
local T_V_LIB64 = ( $( prefix_match "vendor/lib64/" ) )
local T_V_LIB64 = ( $( prefix_match "vendor/lib64/" ) )
local V_MULTILIBS = ( $( comm -12 <( printf '%s\n' " ${ T_V_LIB32 [@] } " ) <( printf '%s\n' " ${ T_V_LIB64 [@] } " ) ) )
local V_MULTILIBS = ( $( comm -12 <( printf '%s\n' " ${ T_V_LIB32 [@] } " ) <( printf '%s\n' " ${ T_V_LIB64 [@] } " ) ) )
@ -528,6 +545,14 @@ function write_product_packages() {
if [ " ${# PRIV_APPS [@] } " -gt "0" ] ; then
if [ " ${# PRIV_APPS [@] } " -gt "0" ] ; then
write_packages "APPS" "" "priv-app" "PRIV_APPS" >> " $ANDROIDMK "
write_packages "APPS" "" "priv-app" "PRIV_APPS" >> " $ANDROIDMK "
fi
fi
local S_APPS = ( $( prefix_match "system/app/" ) )
if [ " ${# S_APPS [@] } " -gt "0" ] ; then
write_packages "APPS" "system" "" "S_APPS" >> " $ANDROIDMK "
fi
local S_PRIV_APPS = ( $( prefix_match "system/priv-app/" ) )
if [ " ${# S_PRIV_APPS [@] } " -gt "0" ] ; then
write_packages "APPS" "system" "priv-app" "S_PRIV_APPS" >> " $ANDROIDMK "
fi
local V_APPS = ( $( prefix_match "vendor/app/" ) )
local V_APPS = ( $( prefix_match "vendor/app/" ) )
if [ " ${# V_APPS [@] } " -gt "0" ] ; then
if [ " ${# V_APPS [@] } " -gt "0" ] ; then
write_packages "APPS" "vendor" "" "V_APPS" >> " $ANDROIDMK "
write_packages "APPS" "vendor" "" "V_APPS" >> " $ANDROIDMK "
@ -558,6 +583,10 @@ function write_product_packages() {
if [ " ${# FRAMEWORK [@] } " -gt "0" ] ; then
if [ " ${# FRAMEWORK [@] } " -gt "0" ] ; then
write_packages "JAVA_LIBRARIES" "" "" "FRAMEWORK" >> " $ANDROIDMK "
write_packages "JAVA_LIBRARIES" "" "" "FRAMEWORK" >> " $ANDROIDMK "
fi
fi
local S_FRAMEWORK = ( $( prefix_match "system/framework/" ) )
if [ " ${# S_FRAMEWORK [@] } " -gt "0" ] ; then
write_packages "JAVA_LIBRARIES" "system" "" "S_FRAMEWORK" >> " $ANDROIDMK "
fi
local V_FRAMEWORK = ( $( prefix_match "vendor/framework/" ) )
local V_FRAMEWORK = ( $( prefix_match "vendor/framework/" ) )
if [ " ${# V_FRAMEWORK [@] } " -gt "0" ] ; then
if [ " ${# V_FRAMEWORK [@] } " -gt "0" ] ; then
write_packages "JAVA_LIBRARIES" "vendor" "" "V_FRAMEWORK" >> " $ANDROIDMK "
write_packages "JAVA_LIBRARIES" "vendor" "" "V_FRAMEWORK" >> " $ANDROIDMK "
@ -576,6 +605,10 @@ function write_product_packages() {
if [ " ${# ETC [@] } " -gt "0" ] ; then
if [ " ${# ETC [@] } " -gt "0" ] ; then
write_packages "ETC" "" "" "ETC" >> " $ANDROIDMK "
write_packages "ETC" "" "" "ETC" >> " $ANDROIDMK "
fi
fi
local S_ETC = ( $( prefix_match "system/etc/" ) )
if [ " ${# ETC [@] } " -gt "0" ] ; then
write_packages "ETC" "system" "" "S_ETC" >> " $ANDROIDMK "
fi
local V_ETC = ( $( prefix_match "vendor/etc/" ) )
local V_ETC = ( $( prefix_match "vendor/etc/" ) )
if [ " ${# V_ETC [@] } " -gt "0" ] ; then
if [ " ${# V_ETC [@] } " -gt "0" ] ; then
write_packages "ETC" "vendor" "" "V_ETC" >> " $ANDROIDMK "
write_packages "ETC" "vendor" "" "V_ETC" >> " $ANDROIDMK "
@ -594,6 +627,10 @@ function write_product_packages() {
if [ " ${# BIN [@] } " -gt "0" ] ; then
if [ " ${# BIN [@] } " -gt "0" ] ; then
write_packages "EXECUTABLES" "" "" "BIN" >> " $ANDROIDMK "
write_packages "EXECUTABLES" "" "" "BIN" >> " $ANDROIDMK "
fi
fi
local S_BIN = ( $( prefix_match "system/bin/" ) )
if [ " ${# BIN [@] } " -gt "0" ] ; then
write_packages "EXECUTABLES" "system" "" "S_BIN" >> " $ANDROIDMK "
fi
local V_BIN = ( $( prefix_match "vendor/bin/" ) )
local V_BIN = ( $( prefix_match "vendor/bin/" ) )
if [ " ${# V_BIN [@] } " -gt "0" ] ; then
if [ " ${# V_BIN [@] } " -gt "0" ] ; then
write_packages "EXECUTABLES" "vendor" "" "V_BIN" >> " $ANDROIDMK "
write_packages "EXECUTABLES" "vendor" "" "V_BIN" >> " $ANDROIDMK "