Skip to content

Instantly share code, notes, and snippets.

@heatd
Created July 24, 2022 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heatd/9cee7e6a3c9e538839d8e4690c670830 to your computer and use it in GitHub Desktop.
Save heatd/9cee7e6a3c9e538839d8e4690c670830 to your computer and use it in GitHub Desktop.
#!/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