summaryrefslogtreecommitdiff
path: root/nuttx/examples/nxflat/tests/mksymtab.sh
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-06-21 18:09:39 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-06-21 18:09:39 +0000
commit622ea63d734f5a3e86eaffac117d6fb66507ec7f (patch)
treeb76c752f7e5693fb75712fb03a7fb8c13b06eee6 /nuttx/examples/nxflat/tests/mksymtab.sh
parentae15cd5e53907a95e42586d1a96a24b71299349d (diff)
downloadnuttx-622ea63d734f5a3e86eaffac117d6fb66507ec7f.tar.gz
nuttx-622ea63d734f5a3e86eaffac117d6fb66507ec7f.tar.bz2
nuttx-622ea63d734f5a3e86eaffac117d6fb66507ec7f.zip
Finishes first cut of examples/nxflat
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1922 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/nxflat/tests/mksymtab.sh')
-rwxr-xr-xnuttx/examples/nxflat/tests/mksymtab.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/nuttx/examples/nxflat/tests/mksymtab.sh b/nuttx/examples/nxflat/tests/mksymtab.sh
new file mode 100755
index 000000000..a5161ae73
--- /dev/null
+++ b/nuttx/examples/nxflat/tests/mksymtab.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+usage="Usage: %0 <test-dir-path>"
+
+dir=$1
+if [ -z "$dir" ]; then
+ echo "ERROR: Missing <test-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
+
+varlist=`find $dir -name "*-thunk.S"| xargs grep -h asciz | cut -f3 | sort | uniq`
+
+echo "#ifndef __EXAMPLES_NXFLAT_TESTS_SYMTAB_H"
+echo "#define __EXAMPLES_NXFLAT_TESTS_SYMTAB_H"
+echo ""
+echo "#include <nuttx/symtab.h>"
+echo ""
+echo "static const struct symtab_s exports[] = "
+echo "{"
+for string in $varlist; do
+ var=`echo $string | sed -e "s/\"//g"`
+ echo " {$string, $var},"
+done
+
+echo "};"
+echo "#define NEXPORTS (sizeof(exports)/sizeof(struct symtab_s))"
+echo ""
+echo "#endif /* __EXAMPLES_NXFLAT_TESTS_SYMTAB_H */"
+