aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-08-11 21:47:20 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-08-11 22:39:25 +0200
commit159ef2c0c6e2c6a98e86bf35e9e9f8233dd4c852 (patch)
tree0a03a7a1b2f8e309088660569fd342cd838ff08d
parent934461d4f0644af5372d460e2889fe118489181b (diff)
downloadvendor_lineage-159ef2c0c6e2c6a98e86bf35e9e9f8233dd4c852.tar.gz
vendor_lineage-159ef2c0c6e2c6a98e86bf35e9e9f8233dd4c852.tar.bz2
vendor_lineage-159ef2c0c6e2c6a98e86bf35e9e9f8233dd4c852.zip
clean-mesa: Add new version from allmod targets
This should be more complete as we clean all targets. Thanks to dllud for the pointer on how to get mesa targets. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rwxr-xr-xclean-mesa.sh135
1 files changed, 125 insertions, 10 deletions
diff --git a/clean-mesa.sh b/clean-mesa.sh
index 29bce949..30c0b313 100755
--- a/clean-mesa.sh
+++ b/clean-mesa.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright (C) 2020 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
#
# This program is free software: you can redistribute it and/or modify
@@ -13,6 +13,7 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+set -e
usage()
{
@@ -29,14 +30,128 @@ elif [ "$1" != "clean" ] ; then
fi
if [ -z "${OUT}" ] ; then
- echo "Error: cannot find \$OUT"
- echo "You might need to run the following commands in the current shell:"
- echo " source build/envsetup.sh"
- echo " lunch <target>"
- exit 1
+ echo "Error: cannot find \$OUT"
+ echo "You might need to run these commands in the current shell:"
+ echo " source build/envsetup.sh"
+ echo " lunch <target>"
+ exit 1
fi
-rm -rf "${OUT}"/obj/STATIC_LIBRARIES/libmesa_*
-rm -rf "${OUT}"/gen/STATIC_LIBRARIES/libmesa_*
-rm -rf "${OUT}"/symbols/system/vendor/lib/egl/libGLES_mesa.so
-rm -rf "${OUT}"/system/vendor/lib/egl/libGLES_mesa.so
+targets="clean-libGLES_mesa"
+
+# This has been generated by allmod | grep "^libmesa_"
+# We cannot easily access the allmod function as it is available in the parent
+# shell which we don't have access to. Exporting it would need to be done from
+# build/envsetup.sh and we would also need to make sure that this function has
+# access to all the environment variables it needs to work properly.
+libmesa=" \
+ libmesa_amd_common \
+ libmesa_amdgpu_addrlib \
+ libmesa_anv_gen10 \
+ libmesa_anv_gen11 \
+ libmesa_anv_gen12 \
+ libmesa_anv_gen7 \
+ libmesa_anv_gen75 \
+ libmesa_anv_gen8 \
+ libmesa_anv_gen9 \
+ libmesa_blorp \
+ libmesa_broadcom_cle \
+ libmesa_broadcom_genxml \
+ libmesa_compiler \
+ libmesa_dri_common \
+ libmesa_dricore \
+ libmesa_gallium \
+ libmesa_galliumvl \
+ libmesa_genxml \
+ libmesa_git_sha1 \
+ libmesa_glsl \
+ libmesa_glsl_utils \
+ libmesa_glsl_utils_32 \
+ libmesa_i965_gen10 \
+ libmesa_i965_gen11 \
+ libmesa_i965_gen4 \
+ libmesa_i965_gen45 \
+ libmesa_i965_gen5 \
+ libmesa_i965_gen6 \
+ libmesa_i965_gen7 \
+ libmesa_i965_gen75 \
+ libmesa_i965_gen8 \
+ libmesa_i965_gen9 \
+ libmesa_intel_common \
+ libmesa_intel_compiler \
+ libmesa_intel_dev \
+ libmesa_intel_perf \
+ libmesa_iris_gen10 \
+ libmesa_iris_gen11 \
+ libmesa_iris_gen12 \
+ libmesa_iris_gen8 \
+ libmesa_iris_gen9 \
+ libmesa_isl \
+ libmesa_isl_gen10 \
+ libmesa_isl_gen11 \
+ libmesa_isl_gen12 \
+ libmesa_isl_gen4 \
+ libmesa_isl_gen5 \
+ libmesa_isl_gen6 \
+ libmesa_isl_gen7 \
+ libmesa_isl_gen75 \
+ libmesa_isl_gen8 \
+ libmesa_isl_gen9 \
+ libmesa_isl_tiled_memcpy \
+ libmesa_loader \
+ libmesa_megadriver_stub \
+ libmesa_nir \
+ libmesa_pipe_etnaviv \
+ libmesa_pipe_freedreno \
+ libmesa_pipe_i915 \
+ libmesa_pipe_iris \
+ libmesa_pipe_kmsro \
+ libmesa_pipe_lima \
+ libmesa_pipe_llvmpipe \
+ libmesa_pipe_loader \
+ libmesa_pipe_nouveau \
+ libmesa_pipe_panfrost \
+ libmesa_pipe_r300 \
+ libmesa_pipe_r600 \
+ libmesa_pipe_radeonsi \
+ libmesa_pipe_softpipe \
+ libmesa_pipe_svga \
+ libmesa_pipe_vc4 \
+ libmesa_pipe_virgl \
+ libmesa_program \
+ libmesa_st_dri \
+ libmesa_st_mesa \
+ libmesa_util \
+ libmesa_vulkan_common \
+ libmesa_vulkan_util \
+ libmesa_winsys_amdgpu \
+ libmesa_winsys_etnaviv \
+ libmesa_winsys_freedreno \
+ libmesa_winsys_i915 \
+ libmesa_winsys_iris \
+ libmesa_winsys_kmsro \
+ libmesa_winsys_lima \
+ libmesa_winsys_nouveau \
+ libmesa_winsys_panfrost \
+ libmesa_winsys_radeon \
+ libmesa_winsys_svga \
+ libmesa_winsys_sw_dri \
+ libmesa_winsys_sw_kms_dri \
+ libmesa_winsys_vc4 \
+ libmesa_winsys_virgl \
+ libmesa_winsys_virgl_common \
+ libmesa_winsys_virgl_vtest \
+"
+
+# allmod | grep "^libmesa_" produces 96 targets which we added in ${libmesa}.
+# Since we don't have access to BOARD_GPU_DRIVERS even in the parent shell as it
+# is not exported to the shell by lunch, and that we are not going to parse the
+# whole Android build system in this script either, we clean all the possible
+# targets in one make commands. It has been shown to be fast enough on an
+# F2A85M-pro with an Athlon X4 740 CPU, 16G of RAM and an SSD.
+
+for lib in ${libmesa} ; do
+ targets="${targets} clean-${lib}"
+done
+
+make ${targets}