aboutsummaryrefslogtreecommitdiff
path: root/meta/bootstrap.sh
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-02-07 23:07:57 -0500
committerMustafa Quraish <[email protected]>2022-02-08 02:07:18 -0500
commite5f2fac8c5ae5a1b74335816836872c2e24904e6 (patch)
treeed131049d39320967d8d18f65749c08ebb2f79a0 /meta/bootstrap.sh
parentMark bootstrap files as binary in `.gitattributes` (diff)
downloadcup-master.tar.xz
cup-master.zip
[cup] Add `>>` and `<<` operators, `fork()` buildin and `SYS_execve`HEADmaster
Diffstat (limited to 'meta/bootstrap.sh')
-rwxr-xr-xmeta/bootstrap.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/meta/bootstrap.sh b/meta/bootstrap.sh
new file mode 100755
index 0000000..bc8b437
--- /dev/null
+++ b/meta/bootstrap.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Bootstrap the initial compiler, and verify that it works.
+
+set -e
+
+case "$(uname -s)" in
+ Darwin)
+ cp bootstrap/macos.nasm bootstrap/cup.nasm
+ ;;
+ Linux)
+ cp bootstrap/linux.nasm bootstrap/cup.nasm
+ ;;
+esac
+
+echo "[+] Compiling the bootstrap compiler..."
+make bootstrap/cup.out
+mkdir -p build
+
+echo "[+] Creating build/cup.out with bootstrap compiler..."
+./bootstrap/cup.out compiler/main.cup -o build/cup.nasm
+make build/cup.out
+rm -f bootstrap/cup.nasm
+
+echo "[+] Bootstrap complete!" \ No newline at end of file