annotate compile @ 317:6dfbf5691a7f

Move where additional parameters are inserted in gcc command line so that additional libs can be specified
author Michael Pavone <pavone@retrodev.com>
date Thu, 19 Mar 2015 22:39:42 -0700
parents f2aff12d8e87
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #!/bin/sh
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
2
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3 cname=`basename $1`.c
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
4
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
5 if test -f "$cname"; then
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
6 rm "$cname"
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
7 fi
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
8
313
f2aff12d8e87 Make running compiler work from arbitrary working directories
Michael Pavone <pavone@retrodev.com>
parents: 303
diff changeset
9 dir=`dirname $0`
f2aff12d8e87 Make running compiler work from arbitrary working directories
Michael Pavone <pavone@retrodev.com>
parents: 303
diff changeset
10 $dir/tpc $1 -o $cname -basedir $dir/
36
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
11
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
12 if test ! -s "$cname"; then
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13 echo "Compilation to C failed"
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
14 exit 1
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
15 fi
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
16
148
5071d601fe70 Fix small bug in compile script
Mike Pavone <pavone@retrodev.com>
parents: 79
diff changeset
17 bin=`echo $1 | sed 's/\.tp//'`
36
3b0503a67165 Add scripts for building programs via C using d8 rather than a browser
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
18 shift
313
f2aff12d8e87 Make running compiler work from arbitrary working directories
Michael Pavone <pavone@retrodev.com>
parents: 303
diff changeset
19 echo gcc $@ -o $bin $cname $dir/runtime/object.c -lgc
317
6dfbf5691a7f Move where additional parameters are inserted in gcc command line so that additional libs can be specified
Michael Pavone <pavone@retrodev.com>
parents: 313
diff changeset
20 gcc -o $bin $cname $dir/runtime/object.c -I$dir $@ -lgc