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:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Copyright 2021 Johannes Marbach
|
# Copyright 2022 Johannes Marbach, Oliver Smith
|
||||||
#
|
#
|
||||||
# This file is part of unl0kr, hereafter referred to as the program.
|
# 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
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
find lv_drivers -name '*.c'
|
||||||
find "$1" -name "*.mk" | while IFS= read -r makefile; do
|
find lvgl/src/core -name '*.c'
|
||||||
grep "^CSRCS\s*+=" "$makefile" | sed "s|.*=\s*||g" | while read -r expr; do
|
find lvgl/src/draw -name '*.c'
|
||||||
dir=$(dirname "$makefile")
|
find lvgl/src/extra -name '*.c'
|
||||||
|
find lvgl/src/font -name '*.c'
|
||||||
# Ignore example code
|
find lvgl/src/hal -name '*.c'
|
||||||
if [ "${dir%examples}" != "$dir" ]; then
|
find lvgl/src/misc -name '*.c'
|
||||||
continue
|
find lvgl/src/widgets -name '*.c'
|
||||||
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
|
|
||||||
|
Reference in New Issue
Block a user