From e8fff45ac3bd4cc02e4889d9a28a0ebcd5c6d1b9 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 24 Nov 2025 13:00:38 +0100 Subject: bootstrapping 🎉 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ bootstrap.sh | 20 ++++++++++++++++++++ todo.txt | 3 +-- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100755 bootstrap.sh diff --git a/.gitignore b/.gitignore index 7288abd..45ac1dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ antcc +antcc0 +antcc1 +antcc2 build/ test/build/ test/log.txt 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 diff --git a/todo.txt b/todo.txt index a03ee11..e170f88 100644 --- a/todo.txt +++ b/todo.txt @@ -1,6 +1,5 @@ Things to finish before moving onto compiler optimizations, C extensions, other nice features -- self host -- working?? test thoroughly -- fix preprocessor regressions though - e.g. +- fix preprocessor regressions - e.g. at some point add another backend like arm64 to make sure the non target specific stuff is generic enough.. -- cgit v1.2.3