find-lvgl-sources: simplify

Replace the script with simple find commands, that don't pull in
unrelated demo/asset files to speed up the build.
This commit is contained in:
Oliver Smith
2022-06-19 19:33:27 +02:00
parent dba19bff31
commit 18d6a36749

View File

@@ -1,6 +1,6 @@
#!/bin/sh
# Copyright 2021 Johannes Marbach
# Copyright 2022 Johannes Marbach, Oliver Smith
#
# This file is part of unl0kr, hereafter referred to as the program.
#
@@ -17,44 +17,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
find "$1" -name "*.mk" | while IFS= read -r makefile; do
grep "^CSRCS\s*+=" "$makefile" | sed "s|.*=\s*||g" | while read -r expr; do
dir=$(dirname "$makefile")
# Ignore example code
if [ "${dir%examples}" != "$dir" ]; then
continue
fi
# Handle full & relative paths
if echo "$expr" | grep -q '$(LVGL_DIR'; then
expr=$(echo "$expr" \
| sed 's|$(LVGL_DIR)/||g' \
| sed 's|$(LVGL_DIR_NAME)/|lvgl/|g' \
| sed 's|$(LV_DRIVERS_DIR_NAME)/|lv_drivers/|g')
else
expr="$dir/$expr"
fi
# Map erroneous(?) paths
expr=$(echo "$expr" | sed 's|gpu/lv_gpu_nxp_pxp.c|draw/nxp_pxp/lv_gpu_nxp_pxp.c|g')
expr=$(echo "$expr" | sed 's|gpu/lv_gpu_nxp_pxp_osa.c|draw/nxp_pxp/lv_gpu_nxp_pxp_osa.c|g')
expr=$(echo "$expr" | sed 's|gpu/lv_gpu_nxp_vglite.c|draw/nxp_vglite/lv_gpu_nxp_vglite.c|g')
expr=$(echo "$expr" | sed 's|gpu/lv_gpu_stm32_dma2d.c|draw/stm32_dma2d/lv_gpu_stm32_dma2d.c|g')
# Resolve $(wildcard ...)
expr=$(echo "$expr" | sed 's|$(wildcard\s*\(.*\))|\1|g')
# Resolve $(shell ...)
if echo "$expr" | grep -q '$(shell'; then
expr=$(echo "$expr" | sed 's|$(shell\s*\(.*\))|\1|g')
expr=$(eval "$expr")
fi
# Resolve wildcards
for file in $expr; do
echo $file
done
done
done
find lv_drivers -name '*.c'
find lvgl/src/core -name '*.c'
find lvgl/src/draw -name '*.c'
find lvgl/src/extra -name '*.c'
find lvgl/src/font -name '*.c'
find lvgl/src/hal -name '*.c'
find lvgl/src/misc -name '*.c'
find lvgl/src/widgets -name '*.c'