aboutsummaryrefslogtreecommitdiffhomepage
path: root/bootstrap.sh
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-11-24 13:00:38 +0100
committerlemon <lsof@mailbox.org>2025-11-24 13:00:38 +0100
commite8fff45ac3bd4cc02e4889d9a28a0ebcd5c6d1b9 (patch)
tree38466188f4fe37f37df6bf1a6dd1ce2525d771ff /bootstrap.sh
parent5ba62d79923a48c1b1f6a8fc236650f5a8281844 (diff)
bootstrapping 🎉
Diffstat (limited to 'bootstrap.sh')
-rwxr-xr-xbootstrap.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
new file mode 100755
index 0000000..56f0477
--- /dev/null
+++ b/bootstrap.sh
@@ -0,0 +1,20 @@
+#!/bin/env sh
+
+set -euo pipefail
+cc=gcc
+cflags="-std=c11"
+src=$(grep -o '\([_A-Za-z0-9/]\)\+\.c' < Makefile)
+X() {
+ echo "> $@" | sed -s 's/\([^ ]\+\.c \?\)\{10\}$/.../'
+ $@
+}
+echo "== Stage 0 (compiling with $cc) =="
+X $cc $cflags -o antcc0 $src
+echo
+echo "== Stage 1 (compiling with stage 0 output) =="
+X ./antcc0 $cflags -o antcc1 $src
+X md5sum antcc1
+echo
+echo "== Stage 2 (compiling with stage 1 output) =="
+X ./antcc1 $cflags -o antcc2 $src
+X md5sum antcc2