s3e: fix build break
[calu.git] / 3_test / exectest.sh
index 8bb844b280cdb21e20aec48afb198fe8f3ce19c5..77ac27da596fbd76abddbc20ebad9b07eaa1ad0c 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash -x
+#!/bin/bash
 
 ARG2=$2
 
@@ -10,8 +10,8 @@ cleantools() {
 }
 
 buildtools() {
-       make -C ../3a_asm all
-       make -C ../3b_sim all
+       make -C ../3a_asm -j3 all
+       make -C ../3b_sim -j3 all
 }
 
 runasm() {
@@ -22,6 +22,14 @@ runasm() {
        ../3a_asm/dtas < $ARG2 > ${ARG2%.s}.dthex
 }
 
+runasmbin() {
+       if [ "$ARG2" == ""  ]; then
+               echo "runasm: please provide a assembler file"
+               exit 1
+       fi
+       ../3a_asm/dtas -b < $ARG2 > ${ARG2%.s}_bin.dthex
+}
+
 runsim() {
        if [ "$ARG2" == ""  ]; then
                echo "runsim: please provide a dthex file"
@@ -30,11 +38,24 @@ runsim() {
        cd ../3b_sim; ./sim -f ../3_test/$ARG2
 }
 
+runasmsim() {
+       if [ "$ARG2" == ""  ]; then
+               echo "runasm: please provide a assembler file"
+               exit 1
+       fi
+       ../3a_asm/dtas < $ARG2 > ${ARG2%.s}.dthex
+       cd ../3b_sim; ./sim -f ../3_test/${ARG2%.s}.dthex
+}
+
 case $1 in
        clean) cleantools;;
        build) buildtools;;
        asm) runasm;;
+       asmbin) runasmbin;;
        sim) runsim;;
-       *) echo "first argument must be clean|build|asm <file>|sim <file>"
+       asmsim) runasmsim;;
+       *) echo "first argument must be clean|build|"
+          echo "asm <file.s>|asmbin <file.s>|"
+          echo "sim <file.dthex>|asmsim <file.s>"
 esac