From da640c5a467bfdf7b3bbced52fc13a28fd8b37bd Mon Sep 17 00:00:00 2001
From: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Sun, 27 Mar 2016 18:17:08 -0400
Subject: [PATCH] move tools to the root

---
 src/tools/abitest.sh => tools/abifuzz.sh | 13 +++++++------
 src/tools/abi.ml => tools/callgen.ml     |  4 +++-
 {src/tools => tools}/fptox.c             |  0
 {src/tools => tools}/pmov.c              |  0
 {src/tools => tools}/regress.sh          |  0
 5 files changed, 10 insertions(+), 7 deletions(-)
 rename src/tools/abitest.sh => tools/abifuzz.sh (83%)
 rename src/tools/abi.ml => tools/callgen.ml (99%)
 rename {src/tools => tools}/fptox.c (100%)
 rename {src/tools => tools}/pmov.c (100%)
 rename {src/tools => tools}/regress.sh (100%)

diff --git a/src/tools/abitest.sh b/tools/abifuzz.sh
similarity index 83%
rename from src/tools/abitest.sh
rename to tools/abifuzz.sh
index d5b16e5..5945082 100755
--- a/src/tools/abitest.sh
+++ b/tools/abifuzz.sh
@@ -1,7 +1,8 @@
 #!/bin/sh
 
-OCAMLC=/usr/bin/ocamlc
-QBE=`pwd`/qbe
+OCAMLC=${OCAMLC:-/usr/bin/ocamlc}
+DIR=`readlink -f $0 | xargs dirname`
+QBE=$DIR/../src/qbe
 
 failure() {
 	echo "Failure at stage:" $1 >&2
@@ -13,7 +14,7 @@ cleanup() {
 }
 
 init() {
-	cp tools/abi.ml $TMP
+	cp $DIR/callgen.ml $TMP
 	pushd $TMP > /dev/null
 
 	cat > Makefile << EOM
@@ -29,7 +30,7 @@ test: caller.o callee.o
 
 EOM
 
-	if ! $OCAMLC abi.ml -o gentest
+	if ! $OCAMLC callgen.ml -o callgen
 	then
 		popd > /dev/null
 		cleanup
@@ -41,9 +42,9 @@ EOM
 once() {
 	if test -z "$3"
 	then
-		$TMP/gentest $TMP $1 $2
+		$TMP/callgen $TMP $1 $2
 	else
-		$TMP/gentest -s $3 $TMP $1 $2
+		$TMP/callgen -s $3 $TMP $1 $2
 	fi
 	make -C $TMP test > /dev/null || failure "building"
 	$TMP/test || failure "runtime"
diff --git a/src/tools/abi.ml b/tools/callgen.ml
similarity index 99%
rename from src/tools/abi.ml
rename to tools/callgen.ml
index d845c74..9a5976c 100644
--- a/src/tools/abi.ml
+++ b/tools/callgen.ml
@@ -1,4 +1,6 @@
-(* fuzzer *)
+(* abi fuzzer, generates two modules one calling
+ * the other in two possibly different languages
+ *)
 
 type _ bty =
   | Char: int bty
diff --git a/src/tools/fptox.c b/tools/fptox.c
similarity index 100%
rename from src/tools/fptox.c
rename to tools/fptox.c
diff --git a/src/tools/pmov.c b/tools/pmov.c
similarity index 100%
rename from src/tools/pmov.c
rename to tools/pmov.c
diff --git a/src/tools/regress.sh b/tools/regress.sh
similarity index 100%
rename from src/tools/regress.sh
rename to tools/regress.sh