diff --git a/emul/.gitignore b/emul/.gitignore index ae9e1d9..6955b1f 100644 --- a/emul/.gitignore +++ b/emul/.gitignore @@ -3,5 +3,5 @@ /stage2 /forth /*-bin.h -/stage1.bin +/stage0.bin /blkfs diff --git a/emul/Makefile b/emul/Makefile index 7f4e648..751fb26 100644 --- a/emul/Makefile +++ b/emul/Makefile @@ -14,7 +14,10 @@ $(BLKPACK): $(BIN2C): $(BLKPACK) $(BLKUNPACK): $(BLKPACK) -stage0-bin.h: $(BIN2C) +stage0.bin: stage2 xcomp.fs + cat xcomp.fs | ./stage2 > stage0.bin + +stage0-bin.h: stage0.bin $(BIN2C) $(BIN2C) KERNEL < stage0.bin > $@ stage1: stage.c $(OBJS) stage0-bin.h @@ -23,13 +26,11 @@ stage1: stage.c $(OBJS) stage0-bin.h stage1dbg: stage.c $(OBJS) stage0-bin.h $(CC) -DDEBUG stage.c $(OBJS) -o $@ -stage1.bin: stage1.fs stage1 - ./stage1 < stage1.fs > $@ +# not dependent on forth.bin to avoid circular deps. +forth-bin.h: $(BIN2C) + $(BIN2C) KERNEL < forth.bin > $@ -stage1-bin.h: stage1.bin $(BIN2C) - $(BIN2C) KERNEL < stage1.bin > $@ - -stage2: stage.c $(OBJS) stage1-bin.h blkfs-bin.h +stage2: stage.c $(OBJS) forth-bin.h blkfs-bin.h $(CC) -DSTAGE2 stage.c $(OBJS) -o $@ blkfs: $(BLKPACK) @@ -38,7 +39,7 @@ blkfs: $(BLKPACK) blkfs-bin.h: blkfs $(BIN2C) $(BIN2C) BLKFS < blkfs > $@ -forth: forth.c $(OBJS) stage1-bin.h blkfs-bin.h +forth: forth.c $(OBJS) forth-bin.h blkfs-bin.h $(CC) forth.c $(OBJS) -o $@ libz80/libz80.o: libz80/z80.c @@ -50,8 +51,8 @@ emul.o: emul.c .PHONY: updatebootstrap -updatebootstrap: stage2 - cat xcomp.fs | ./stage2 > stage0.bin +updatebootstrap: stage1 stage1.fs + ./stage1 < stage1.fs > forth.bin .PHONY: pack pack: diff --git a/emul/forth.bin b/emul/forth.bin new file mode 100644 index 0000000..c2de2e4 Binary files /dev/null and b/emul/forth.bin differ diff --git a/emul/forth.c b/emul/forth.c index cd10bbb..f73f00a 100644 --- a/emul/forth.c +++ b/emul/forth.c @@ -3,7 +3,7 @@ #include #include #include "emul.h" -#include "stage1-bin.h" +#include "forth-bin.h" #include "blkfs-bin.h" // in sync with glue.asm diff --git a/emul/stage.c b/emul/stage.c index 27d4aea..36ec647 100644 --- a/emul/stage.c +++ b/emul/stage.c @@ -3,7 +3,7 @@ #include #include "emul.h" #ifdef STAGE2 -#include "stage1-bin.h" +#include "forth-bin.h" #include "blkfs-bin.h" #else #include "stage0-bin.h" diff --git a/emul/stage0.bin b/emul/stage0.bin deleted file mode 100644 index 219ea69..0000000 Binary files a/emul/stage0.bin and /dev/null differ