ref: 2fd69143d0b5fc1e09c8e2b9a6ca7d285c785068
parent: fce1357635f7513fe19e9249597917829a0aaf1c
author: grobe0ba <grobe0ba@tcp80.org>
date: Thu Apr 20 11:40:36 EDT 2023
bootstrap on *nix using Makefile Signed-off-by: grobe0ba <grobe0ba@tcp80.org>
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,7 @@
3rd/mp/u64.o\
3rd/mt19937-64.o\
-.PHONY: all default test clean
+.PHONY: all default test bootstrap clean
all: default
@@ -78,8 +78,17 @@
boot.h: flisp.boot
sed 's,\\,\\\\,g;s,",\\",g;s,^,",g;s,$$,\\n",g' flisp.boot >$@
-builtin_fns.h:
+builtin_fns.h: *.c
sed -nE 's/^BUILTIN[_]?(\(".*)/BUILTIN_FN\1/gp' *.c >$@+
+bootstrap: ${TARG} builtin_fns.h mkboot0.lsp mkboot1.lsp+ cp flisp.boot flisp.boot.bak
+ ./${TARG} gen.lsp+ ./${TARG} mkboot0.lsp instructions.lsp builtins.lsp system.lsp compiler.lsp >flisp.boot+ ${MAKE} clean+ ${MAKE} ${TARG}+ ./${TARG} mkboot1.lsp+ ${MAKE} testclean:
rm -f ${OBJS} ${TARG}--- a/bootstrap.sh
+++ /dev/null
@@ -1,17 +1,0 @@
-#!/bin/sh
-set -e
-
-cp flisp.boot flisp.boot.bak
-
-echo "Creating stage 0 boot file..."
-./flisp gen.lsp
-./flisp mkboot0.lsp instructions.lsp builtins.lsp system.lsp compiler.lsp > flisp.boot
-
-echo "Creating stage 1 boot file..."
-make clean
-make -j8
-./flisp mkboot1.lsp
-make -j8
-
-echo "Testing..."
-make test
--
⑨