Created
July 24, 2022 17:43
-
-
Save heatd/9cee7e6a3c9e538839d8e4690c670830 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
shopt -s nullglob | |
ARCHS="x86_64 riscv64 aarch64" | |
SRC_DIRS="src/* src/malloc/mallocng crt ldso" | |
for src in $SRC_DIRS; do | |
BASE_GLOBS="$BASE_GLOBS $src/*.c" | |
for ARCH in $ARCHS; do | |
if [ -d "$src/$ARCH" ]; then | |
glob_var=ARCH_${ARCH}_GLOBS | |
echo $glob_var | |
globs=$(eval echo "$""$glob_var $src/$ARCH/*.c $src/$ARCH/*.s $src/$ARCH/*.S") | |
eval $glob_var="$(echo $globs)" | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment