2017-12-17 17:12:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-03-03 18:49:38 +00:00
|
|
|
rom_script=''
|
|
|
|
if [ -n "$1" ];then
|
2018-08-20 20:24:32 +00:00
|
|
|
if echo "$1" | grep -qF /;then
|
2018-08-30 12:25:08 +00:00
|
|
|
rom_script=''
|
|
|
|
for i in "$@";do
|
|
|
|
rom_script="$rom_script"$'\n''$(call inherit-product, '$i')'
|
|
|
|
done
|
|
|
|
else
|
2018-08-20 20:24:32 +00:00
|
|
|
rom_script='$(call inherit-product, device/phh/treble/'$1'.mk)'
|
|
|
|
fi
|
2018-03-03 18:49:38 +00:00
|
|
|
fi
|
|
|
|
|
2017-12-17 17:12:19 +00:00
|
|
|
echo 'PRODUCT_MAKEFILES := \' > AndroidProducts.mk
|
|
|
|
|
|
|
|
for part in a ab;do
|
2018-05-17 20:19:54 +00:00
|
|
|
for apps in vanilla gapps foss gapps-go;do
|
2018-11-13 21:25:10 +00:00
|
|
|
for arch in arm64 arm a64;do
|
2017-12-19 12:08:26 +00:00
|
|
|
for su in yes no;do
|
|
|
|
apps_suffix=""
|
|
|
|
apps_script=""
|
|
|
|
apps_name=""
|
|
|
|
extra_packages=""
|
2018-05-18 11:49:04 +00:00
|
|
|
vndk="vndk.mk"
|
2019-09-26 20:24:54 +00:00
|
|
|
optional_base=""
|
2017-12-19 12:08:26 +00:00
|
|
|
if [ "$apps" == "gapps" ];then
|
|
|
|
apps_suffix="g"
|
|
|
|
apps_script='$(call inherit-product, device/phh/treble/gapps.mk)'
|
|
|
|
apps_name="with GApps"
|
|
|
|
fi
|
2018-05-17 20:19:54 +00:00
|
|
|
if [ "$apps" == "gapps-go" ];then
|
|
|
|
apps_suffix="o"
|
|
|
|
apps_script='$(call inherit-product, device/phh/treble/gapps-go.mk)'
|
2018-05-18 12:59:22 +00:00
|
|
|
apps_name="Go"
|
2018-05-17 20:19:54 +00:00
|
|
|
fi
|
2017-12-19 12:08:26 +00:00
|
|
|
if [ "$apps" == "foss" ];then
|
|
|
|
apps_suffix="f"
|
|
|
|
apps_script='$(call inherit-product, vendor/foss/foss.mk)'
|
|
|
|
apps_name="with FOSS apps"
|
|
|
|
fi
|
|
|
|
if [ "$apps" == "vanilla" ];then
|
|
|
|
apps_suffix="v"
|
|
|
|
apps_script=''
|
|
|
|
apps_name="vanilla"
|
|
|
|
fi
|
2018-11-13 21:25:10 +00:00
|
|
|
if [ "$arch" == "arm" ];then
|
|
|
|
vndk="vndk-binder32.mk"
|
|
|
|
fi
|
|
|
|
if [ "$arch" == "a64" ];then
|
|
|
|
vndk="vndk32.mk"
|
|
|
|
fi
|
2017-12-17 17:12:19 +00:00
|
|
|
|
2017-12-19 12:08:26 +00:00
|
|
|
su_suffix='N'
|
|
|
|
if [ "$su" == "yes" ];then
|
|
|
|
su_suffix='S'
|
2018-09-04 15:01:12 +00:00
|
|
|
extra_packages+=' phh-su me.phh.superuser'
|
2017-12-19 12:08:26 +00:00
|
|
|
fi
|
2017-12-17 17:12:19 +00:00
|
|
|
|
2017-12-19 12:10:47 +00:00
|
|
|
part_suffix='a'
|
|
|
|
if [ "$part" == 'ab' ];then
|
|
|
|
part_suffix='b'
|
2019-09-26 20:24:54 +00:00
|
|
|
else
|
|
|
|
optional_base='$(call inherit-product, device/phh/treble/base-sas.mk)'
|
2017-12-19 12:10:47 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
target="treble_${arch}_${part_suffix}${apps_suffix}${su_suffix}"
|
2017-12-19 12:08:26 +00:00
|
|
|
|
2019-09-12 18:45:28 +00:00
|
|
|
baseArch="$arch"
|
|
|
|
if [ "$arch" = "a64" ];then
|
|
|
|
baseArch="arm"
|
|
|
|
fi
|
|
|
|
|
|
|
|
zygote=32
|
|
|
|
if [ "$arch" = "arm64" ];then
|
|
|
|
zygote=64_32
|
|
|
|
fi
|
|
|
|
|
2017-12-19 12:08:26 +00:00
|
|
|
cat > ${target}.mk << EOF
|
2019-10-21 15:42:05 +00:00
|
|
|
TARGET_GAPPS_ARCH := ${baseArch}
|
2017-12-30 17:21:46 +00:00
|
|
|
\$(call inherit-product, device/phh/treble/base-pre.mk)
|
2019-09-12 18:45:28 +00:00
|
|
|
include build/make/target/product/aosp_${baseArch}_ab.mk
|
2018-05-18 11:49:04 +00:00
|
|
|
\$(call inherit-product, vendor/vndk/${vndk})
|
2017-12-17 17:12:19 +00:00
|
|
|
\$(call inherit-product, device/phh/treble/base.mk)
|
2019-09-26 20:24:54 +00:00
|
|
|
$optional_base
|
2017-12-17 17:12:19 +00:00
|
|
|
$apps_script
|
2018-03-03 18:49:38 +00:00
|
|
|
$rom_script
|
2017-12-17 17:12:19 +00:00
|
|
|
|
|
|
|
PRODUCT_NAME := $target
|
2018-03-04 16:46:28 +00:00
|
|
|
PRODUCT_DEVICE := phhgsi_${arch}_$part
|
2017-12-17 17:12:19 +00:00
|
|
|
PRODUCT_BRAND := Android
|
|
|
|
PRODUCT_MODEL := Phh-Treble $apps_name
|
2017-12-19 12:08:26 +00:00
|
|
|
|
|
|
|
PRODUCT_PACKAGES += $extra_packages
|
2019-09-12 18:45:28 +00:00
|
|
|
|
2017-12-17 17:12:19 +00:00
|
|
|
EOF
|
|
|
|
echo -e '\t$(LOCAL_DIR)/'$target.mk '\' >> AndroidProducts.mk
|
2017-12-19 12:08:26 +00:00
|
|
|
done
|
2017-12-17 17:12:19 +00:00
|
|
|
done
|
|
|
|
done
|
|
|
|
done
|
|
|
|
echo >> AndroidProducts.mk
|