| 1 | #/bin/bash |
| 2 | |
| 3 | #initialize main.c |
| 4 | printf '#include <stdlib.h>\n' > main.c |
| 5 | printf '\n' >> main.c |
| 6 | printf 'int main(int argc, char** argv)\n' >> main.c |
| 7 | printf '{\n' >> main.c |
| 8 | |
| 9 | #add functions |
| 10 | for file in `find . -type f -name \*.c ! -name main.c`; do |
| 11 | printf "\t//file $file :\n" >> main.c |
| 12 | functions=`grep '^ *void t_' $file | sed 's/^ *void \([^(]*\).*/\t\1();/g'` |
| 13 | printf "$functions" >> main.c |
| 14 | printf '\n\n' >> main.c |
| 15 | done |
| 16 | |
| 17 | #finalize main.c |
| 18 | printf '\treturn 0;\n' >> main.c |
| 19 | printf '}\n' >> main.c |