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