diff options
author | musil <tmusil@users.sourceforge.net> | 2006-03-09 17:05:43 +0000 |
---|---|---|
committer | musil <tmusil@users.sourceforge.net> | 2006-03-09 17:05:43 +0000 |
commit | e5a3c99d0f46d825a5550e88a0906f900e31be52 (patch) | |
tree | e30df3751e6699012e87db2d8c36f531c3e85213 /src/makesource.sh |
initial version JAN_06 with all sourcessvn2git-root
svn path=/trunk/externals/iem/iem_ambi/; revision=4668
Diffstat (limited to 'src/makesource.sh')
-rw-r--r-- | src/makesource.sh | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/makesource.sh b/src/makesource.sh new file mode 100644 index 0000000..32703b1 --- /dev/null +++ b/src/makesource.sh @@ -0,0 +1,65 @@ +#!/bin/sh + +IEMAMBI_H=iem_ambi_sources.h +IEMAMBI_C=iem_ambi_sources.c + +EGREP=egrep +SED=sed +LS=ls + +################################# +## functions + +function head_h() { + echo "/* iem_ambi-setup autogenerated header-file" + echo " * generated by \"$0\"" + echo " * !! DO NOT MANUALLY EDIT !!" + echo " */" + echo + echo "#ifndef IEMAMBI_SOURCES_H__" + echo "#define IEMAMBI_SOURCES_H__" +} + +function foot_h() { + echo "#endif /* IEMAMBI_SOURCES_H__ */" + echo "" +} + +function head_c() { + echo "/* iem_ambi-setup autogenerated setup-file" + echo " * generated by \"$0\"" + echo " * !! DO NOT MANUALLY EDIT !!" + echo " */" + echo + echo "#include \"$IEMAMBI_H\"" + echo + echo "void iem_ambi_sources_setup(void)" + echo "{" +} + +function foot_c() { + echo "}" + echo +} + + +################################## +## body + +head_h > $IEMAMBI_H +head_c > $IEMAMBI_C + +for i in $(${LS} *.c | ${EGREP} -v "iem_bin_ambi.*\.c") +do +## each c-file in iem_ambi needs to have an <file>_setup()-function +## that calls all needed setup-functions +## any non-alpha-numeric-character is replaced by "_" +## e.g. "bla~.c" -> "bla__setup()" + SETUPNAME=$(echo ${i%.c} | ${SED} -e 's/[^[:alnum:]]/_/g')_setup + echo "void ${SETUPNAME}(void); /* $i */" >> $IEMAMBI_H + echo " ${SETUPNAME}(); /* $i */" >> $IEMAMBI_C +done + +foot_h >> $IEMAMBI_H +foot_c >> $IEMAMBI_C + |