diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-10-25 20:06:46 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-10-25 20:06:46 +0000 |
commit | 5ae419f6845ff28bcbdb339cdfb66f6b2e46f9ab (patch) | |
tree | 871dcd80c04a5b65c613cbc80c92a83d7bbbbe46 /apps/examples/elf/tests/mkdirlist.sh | |
parent | 8cbc20e05c24cc3e2b0b4774f4850357b9f46595 (diff) | |
download | nuttx-5ae419f6845ff28bcbdb339cdfb66f6b2e46f9ab.tar.gz nuttx-5ae419f6845ff28bcbdb339cdfb66f6b2e46f9ab.tar.bz2 nuttx-5ae419f6845ff28bcbdb339cdfb66f6b2e46f9ab.zip |
Add an example for testing the ELF loader
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5260 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/elf/tests/mkdirlist.sh')
-rwxr-xr-x | apps/examples/elf/tests/mkdirlist.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/apps/examples/elf/tests/mkdirlist.sh b/apps/examples/elf/tests/mkdirlist.sh new file mode 100755 index 000000000..c790e74c4 --- /dev/null +++ b/apps/examples/elf/tests/mkdirlist.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +usage="Usage: %0 <romfs-dir-path>" + +dir=$1 +if [ -z "$dir" ]; then + echo "ERROR: Missing <romfs-dir-path>" + echo "" + echo $usage + exit 1 +fi + +if [ ! -d "$dir" ]; then + echo "ERROR: Directory $dir does not exist" + echo "" + echo $usage + exit 1 +fi + +echo "#ifndef __EXAMPLES_ELF_TESTS_DIRLIST_H" +echo "#define __EXAMPLES_ELF_TESTS_DIRLIST_H" +echo "" +echo "static const char *dirlist[] =" +echo "{" + +for file in `ls $dir`; do + echo " \"$file\"," +done + +echo " NULL" +echo "};" +echo "" +echo "#endif /* __EXAMPLES_ELF_TESTS_DIRLIST_H */" + + |