" > Makefile
# Append header files dependences.
-for file in $(ls -1 $SRCDIR/*.c $SRCDIR/test/*.c $SRCDIR/test/fuzz/*.c $SRCDIR/$ARCHDIR/*.c $SRCDIR/tools/*.c); do
+for file in $SRCDIR/*.c $SRCDIR/test/*.c $SRCDIR/test/fuzz/*.c $SRCDIR/$ARCHDIR/*.c $SRCDIR/tools/*.c; do
short_name=$(echo $file | sed -e "s#$SRCDIR/##g")
incs=$(grep -h include $file | sed -n 's/# *\include *"\(.*\.h\)".*/\1/p' | sort | uniq)
includes=$(for i in $incs; do
" > $ARCHDIR/Makefile
# Append header files dependences.
-for file in $(ls -1 $SRCDIR/$ARCHDIR/*.c); do
+for file in $SRCDIR/$ARCHDIR/*.c; do
incs=$(grep -h include $file | sed -n 's/# *\include *"\(.*\.h\)".*/\1/p' | sort | uniq)
includes=$(for i in $incs; do
# Check that the include file exists in the current dir,