Update of /cvsroot/pure-data/externals/zexy/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27895
Modified Files: makesource.sh Log Message: improved (setup_functions need not have the same name as the c-file)
Index: makesource.sh =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/makesource.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** makesource.sh 22 Mar 2005 20:58:22 -0000 1.1 --- makesource.sh 17 May 2005 16:46:13 -0000 1.2 *************** *** 5,8 **** --- 5,16 ---- ZEXY_S=Make.source
+ + GREP=grep + AWK=awk + SED=sed + + ################################# + ## functions + function head_h() { echo "/* zexy-setup autogenerated header-file" *************** *** 46,49 **** --- 54,67 ---- }
+ function get_setupfunctions() { + if [ -e "$1" ] + then + $GREP "^void .*_setup(void)" $i | $AWK '{print gensub("_setup.*", "_setup", "g", $2);}' + fi + } + + ################################## + ## body + head_h > $ZEXY_H head_c > $ZEXY_C *************** *** 53,63 **** do NAME="${i%.c}" ! SETUPNAME="void ${NAME}_setup(void)" ! if grep "$SETUPNAME" $i > /dev/null then - # echo ${i%.c} echo " $i \" >> $ZEXY_S ! echo "$SETUPNAME;" >> $ZEXY_H ! echo " ${NAME}_setup();" >> $ZEXY_C fi done --- 71,83 ---- do NAME="${i%.c}" ! SETUPNAMES=`get_setupfunctions $i` ! if [ "$SETUPNAMES" ] then echo " $i \" >> $ZEXY_S ! for SETUPNAME in $SETUPNAMES ! do ! echo "void ${SETUPNAME}(void);" >> $ZEXY_H ! echo " ${SETUPNAME}();" >> $ZEXY_C ! done fi done