aboutsummaryrefslogtreecommitdiff
path: root/scaf/compiler/scafc
diff options
context:
space:
mode:
authorTom Schouten <doelie@users.sourceforge.net>2003-02-28 09:57:32 +0000
committerTom Schouten <doelie@users.sourceforge.net>2003-02-28 09:57:32 +0000
commitfa3fa16330b07b13c8d11f1c83f090c328247547 (patch)
tree14920edb0f4248cd8f0953caa88644498ff12602 /scaf/compiler/scafc
parent240da8f9db69b36778b5bc90701968935ff82413 (diff)
pdp scaf
svn path=/trunk/externals/pdp/; revision=443
Diffstat (limited to 'scaf/compiler/scafc')
-rwxr-xr-xscaf/compiler/scafc44
1 files changed, 44 insertions, 0 deletions
diff --git a/scaf/compiler/scafc b/scaf/compiler/scafc
new file mode 100755
index 0000000..ae800e5
--- /dev/null
+++ b/scaf/compiler/scafc
@@ -0,0 +1,44 @@
+#!/bin/sh
+#scaf->scafo compiler
+
+if test "xx$1" == "xx"
+then
+ echo
+ echo "scaf rules compiler"
+ echo "usage:"
+ echo " scafc source [dest]"
+ echo
+ exit 0
+fi
+
+if test "xx$2" == "xx"
+then
+ DEST=$1o
+else
+ DEST=$2
+fi
+
+if ! test -f $1
+then
+ echo "source module $1 not found."
+ exit 1
+fi
+
+SCAFDIR=`dirname $0`
+if ! test -f $SCAFDIR/scafc.pl;
+then
+ SCAFDIR=`dirname $SCAFDIR`
+ SCAFDIR="$SCAFDIR/lib/scaf"
+ if ! test -f $SCAFDIR/scafc.pl
+ then
+ echo "scaf library not found in $SCAFDIR"
+ exit 1
+ fi
+fi
+
+TMP_S=`tempfile -s .s`
+$SCAFDIR/scafc.pl -I$SCAFDIR $1 > $TMP_S \
+&& gcc -export_dynamic -shared -o $DEST $TMP_S \
+&& strip --strip-unneeded $DEST \
+&& rm $TMP_S \
+|| exit 1