summaryrefslogtreecommitdiff
path: root/tnslc/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tnslc/run.sh')
-rwxr-xr-xtnslc/run.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tnslc/run.sh b/tnslc/run.sh
index c1b19e5..9957e15 100755
--- a/tnslc/run.sh
+++ b/tnslc/run.sh
@@ -1,3 +1,18 @@
#!/bin/bash
+BUILD_DIR="./build"
+ARTIFACTS_DIR="$BUILD_DIR/artifacts"
+
+if [ ! -d $BUILD_DIR ]; then
+ mkdir $BUILD_DIR
+fi
+
+if [ ! -d $ARTIFACTS_DIR ]; then
+ mkdir $ARTIFACTS_DIR
+fi
+
../tint -in tnslc.tnsl -flags "$1"
+mv -f "$1.asm" "$ARTIFACTS_DIR/$1.asm"
+nasm -f elf64 -o "$ARTIFACTS_DIR/$1.o" "$ARTIFACTS_DIR/$1.asm"
+clang -o "./build/${1%.*}" "$ARTIFACTS_DIR/$1.o"
+