shithub: femtolisp

Download patch

ref: 497eb997f7c9d494b7ecd26c52dcac3361ef93e1
parent: b09398e98563c23b6988e77b7b5ab84c0e03ceb7
author: grobe0ba <[email protected]>
date: Thu Apr 20 11:40:36 EDT 2023

bootstrap on *nix using Makefile

Signed-off-by: grobe0ba <[email protected]>

--- 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} test
 
 clean:
 	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