scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

compose.sh (310B)


      1 #!/bin/sh
      2 
      3 rm -f tmp_test.c
      4 rm -f tests.h
      5 rm -f tmp_*.c
      6 
      7 (echo '#include "tests.h"'
      8 echo 'int main()'
      9 echo '{'
     10 
     11 for i in *-*.c
     12 do
     13 	n=`echo $i | sed 's/\(.*\)-.*\.c/\1/'`
     14 	sed s/main/main_$n/ < $i > tmp_$n.c
     15 	echo "int main_$n();" >> tests.h
     16 	echo "main_$n();"
     17 	
     18 done
     19 
     20 echo 'return 0;'
     21 echo '}'
     22 ) > tmp_test.c
     23