annotate compile @ 36:3b0503a67165

Add scripts for building programs via C using d8 rather than a browser
author Mike Pavone <pavone@retrodev.com>
date Tue, 10 Jul 2012 19:22:19 -0700
parents
children 7f635666c73d
rev   line source
pavone@36 1 #!/bin/sh
pavone@36 2
pavone@36 3 cname=`basename $1`.c
pavone@36 4
pavone@36 5 if test -f "$cname"; then
pavone@36 6 rm "$cname"
pavone@36 7 fi
pavone@36 8
pavone@36 9 d8 tpc.js -- $1 > $cname
pavone@36 10
pavone@36 11 if test ! -s "$cname"; then
pavone@36 12 echo "Compilation to C failed"
pavone@36 13 exit 1
pavone@36 14 fi
pavone@36 15
pavone@36 16 bin=`echo $1 | sed s/\.tp//`
pavone@36 17 shift
pavone@36 18 gcc $@ -o $bin $cname runtime/object.c