diff options
Diffstat (limited to 'newlib-tester/do_rst')
-rwxr-xr-x | newlib-tester/do_rst | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/newlib-tester/do_rst b/newlib-tester/do_rst new file mode 100755 index 0000000..3c07c35 --- /dev/null +++ b/newlib-tester/do_rst @@ -0,0 +1,35 @@ +#! /bin/sh +# +# Find all the newlib C files with documentation markup and convert +# them to Rest. +# + +### XXX LOCALIZE THESE +newlib=/home/joel/test-gcc/newlib-cygwin +outd=/home/joel/rtems-work/rtems-docs/newlib-tester/newlib-rest +converter=${newlib}/../NewlibMarkup2SphinxConverter + +startd=`pwd` + +rm -rf ${outd} +mkdir ${outd} + +find ${newlib}/newlib -name "*.c" | \ + sed -e '/libc\/machine\//d' -e '/libc\/sys\//d' | \ + xargs -e grep -l "^FUNCTION" | \ +while read f +do + foutd=`dirname ${f} | sed -e 's/^.*\/newlib\///'` + foutd=${outd}/${foutd} + if [ ! -d ${foutd} ] ; then + mkdir -p ${foutd} + fi + + rstf=`basename ${f} | sed -e 's/\.c$/.rst/'` + # echo "${f} -> ${foutd}/${rstf}" + ${converter}/gen_rst_from_makedoc.py \ + -c ${f} \ + -r ${foutd}/${rstf} + + +done |