diff tools/ecsx @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ecsx	Thu Oct 05 08:04:15 2017 +0100
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# Usage: ecsx b.s pas0.c
+
+HOST=ecs.ox.ac.uk
+ARMGCC='arm-linux-gnueabihf-gcc -marm -march=armv6'
+QEMU=qemu-arm
+
+# Make sure socket directory exists
+mkdir -p ~/.ssh/sockets
+
+# Remote temp directory for this test
+dir="ecsx-$$"
+
+# Form a batch job
+( echo /bin/mkdir -p $dir
+  # Create source files
+  for f in $*; do
+      echo "/bin/cat >$dir/$f <<\\EOF"
+      cat $f
+      echo EOF
+  done
+  # Compile and run
+  echo "(cd $dir; set -x;
+		$ARMGCC $* -static -o b.out && $QEMU ./b.out)"
+  # Delete the directory
+  echo /bin/rm -rf $dir ) \
+    |
+# Submit it to the server, reusing a previous connection if possible
+    ssh -o 'ControlMaster auto' -o 'ControlPath ~/.ssh/sockets/%r@%h-%p' \
+          -o 'ControlPersist 600' $HOST /bin/bash
+