aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornic-gaffney <gaffney_nic@protonmail.com>2023-06-26 00:23:52 -0500
committernic-gaffney <gaffney_nic@protonmail.com>2023-06-26 00:23:52 -0500
commite9ad9c9de91f0a64cfd15c4b93da15e2bf998030 (patch)
treec50be6fc4fcf1c834d0ef12fd9f097a0493da8a0
parentad224b06a4a9049e095cfabd4226287e46b7d658 (diff)
downloadsloth-e9ad9c9de91f0a64cfd15c4b93da15e2bf998030.tar.gz
added build script
-rwxr-xr-xbuild.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index 178169f..1969d00 100755
--- a/build.sh
+++ b/build.sh
@@ -1 +1,17 @@
+# Build Sloth
cargo build --features=llvm-sys/prefer-dynamic
+
+# Compile standard library
+./target/debug/sloth std/stdio.sloth
+mv output.o stdio.o
+./target/debug/sloth std/stdlib.sloth
+mv output.o stdlib.io
+./target/debug/sloth std/stdmath.sloth
+mv output.o stdmath.o
+
+# Compile user program
+./target/debug/sloth "$1"
+mv output.o main.o
+
+# Generate binary
+gcc stdio.o std/stdio.c stdlib.o std/stdlib.c stdmath.o std/stdmath.c main.o -o program