From 1bd191e86a70cff20e68ef64c98ebe0085ef7ce8 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 24 Apr 2020 17:53:58 -0400 Subject: [PATCH] Move /emul/forth/* to /emul Less noisy this way --- emul/.gitignore | 13 ++++++------ emul/Makefile | 50 +++++++++++++++++++++++----------------------- emul/{forth => }/emul.fs | 0 emul/{forth => }/forth.c | 2 +- emul/{forth => }/pre.fs | 0 emul/{forth => }/run.fs | 0 emul/{forth => }/stage.c | 2 +- emul/{forth => }/stop.fs | 0 emul/{forth => }/xcomp.fs | 0 emul/{forth => }/z80c.bin | Bin recipes/rc2014/Makefile | 3 +-- recipes/rc2014/run.fs | 6 ++---- tests/Makefile | 2 +- tests/forth/runtests.sh | 3 +-- 14 files changed, 39 insertions(+), 42 deletions(-) rename emul/{forth => }/emul.fs (100%) rename emul/{forth => }/forth.c (99%) rename emul/{forth => }/pre.fs (100%) rename emul/{forth => }/run.fs (100%) rename emul/{forth => }/stage.c (99%) rename emul/{forth => }/stop.fs (100%) rename emul/{forth => }/xcomp.fs (100%) rename emul/{forth => }/z80c.bin (100%) diff --git a/emul/.gitignore b/emul/.gitignore index 280ca55..026de97 100644 --- a/emul/.gitignore +++ b/emul/.gitignore @@ -1,7 +1,8 @@ -/forth/stage1 -/forth/stage1dbg -/forth/stage2 -/forth/forth -/*/*-bin.h -/*/*.bin +/stage1 +/stage1dbg +/stage2 +/forth +/*-bin.h +/core.bin +/forth?.bin /blkfs diff --git a/emul/Makefile b/emul/Makefile index 7f2f466..0529287 100644 --- a/emul/Makefile +++ b/emul/Makefile @@ -1,7 +1,7 @@ -TARGETS = forth/forth forth/stage2 +TARGETS = forth stage2 # Those Forth source files are in a particular order FORTHSRCS = core.fs cmp.fs print.fs parse.fs readln.fs fmt.fs blk.fs -FORTHSRC_PATHS = ${FORTHSRCS:%=../forth/%} forth/run.fs +FORTHSRC_PATHS = ${FORTHSRCS:%=../forth/%} run.fs OBJS = emul.o libz80/libz80.o SLATEST = ../tools/slatest STRIPFC = ../tools/stripfc @@ -23,43 +23,43 @@ $(BLKUNPACK): $(BLKPACK) # z80c.bin is not in the prerequisites because it's a bootstrap # binary that should be updated manually through make updatebootstrap. -forth/forth0.bin: $(SLATEST) - cp forth/z80c.bin $@ +forth0.bin: $(SLATEST) + cp z80c.bin $@ $(SLATEST) $@ - cat forth/pre.fs forth/emul.fs >> $@ + cat pre.fs emul.fs >> $@ -forth/forth0-bin.h: forth/forth0.bin $(BIN2C) - $(BIN2C) KERNEL < forth/forth0.bin | tee $@ > /dev/null +forth0-bin.h: forth0.bin $(BIN2C) + $(BIN2C) KERNEL < forth0.bin | tee $@ > /dev/null -forth/stage1: forth/stage.c $(OBJS) forth/forth0-bin.h - $(CC) forth/stage.c $(OBJS) -o $@ +stage1: stage.c $(OBJS) forth0-bin.h + $(CC) stage.c $(OBJS) -o $@ -forth/stage1dbg: forth/stage.c $(OBJS) forth/forth0-bin.h - $(CC) -DDEBUG forth/stage.c $(OBJS) -o $@ +stage1dbg: stage.c $(OBJS) forth0-bin.h + $(CC) -DDEBUG stage.c $(OBJS) -o $@ # We don't really need to use stripfc, but we do it anyway to test that we # don't mistakenly break our code with that tool. It's easier to debug here. -forth/core.bin: $(FORTHSRC_PATHS) forth/stage1 - cat $(FORTHSRC_PATHS) ./forth/stop.fs | $(STRIPFC) | ./forth/stage1 > $@ +core.bin: $(FORTHSRC_PATHS) stage1 + cat $(FORTHSRC_PATHS) stop.fs | $(STRIPFC) | ./stage1 > $@ -forth/forth1.bin: forth/core.bin $(SLATEST) - cat forth/z80c.bin forth/core.bin > $@ +forth1.bin: core.bin $(SLATEST) + cat z80c.bin core.bin > $@ $(SLATEST) $@ -forth/forth1-bin.h: forth/forth1.bin $(BIN2C) - $(BIN2C) KERNEL < forth/forth1.bin > $@ +forth1-bin.h: forth1.bin $(BIN2C) + $(BIN2C) KERNEL < forth1.bin > $@ -forth/stage2: forth/stage.c $(OBJS) forth/forth1-bin.h forth/blkfs-bin.h - $(CC) -DSTAGE2 forth/stage.c $(OBJS) -o $@ +stage2: stage.c $(OBJS) forth1-bin.h blkfs-bin.h + $(CC) -DSTAGE2 stage.c $(OBJS) -o $@ blkfs: $(BLKPACK) $(BLKPACK) ../blk > $@ -forth/blkfs-bin.h: blkfs $(BIN2C) +blkfs-bin.h: blkfs $(BIN2C) $(BIN2C) BLKFS < blkfs > $@ -forth/forth: forth/forth.c $(OBJS) forth/forth1-bin.h blkfs - $(CC) forth/forth.c $(OBJS) -o $@ +forth: forth.c $(OBJS) forth1-bin.h blkfs + $(CC) forth.c $(OBJS) -o $@ libz80/libz80.o: libz80/z80.c $(MAKE) -C libz80/codegen opcodes @@ -70,8 +70,8 @@ emul.o: emul.c .PHONY: updatebootstrap -updatebootstrap: forth/stage2 - cat ./forth/xcomp.fs | ./forth/stage2 > ./forth/z80c.bin +updatebootstrap: stage2 + cat xcomp.fs | ./stage2 > z80c.bin .PHONY: pack pack: @@ -83,5 +83,5 @@ unpack: .PHONY: clean clean: - rm -f $(TARGETS) emul.o forth/*-bin.h forth/forth?.bin blkfs + rm -f $(TARGETS) emul.o *-bin.h forth?.bin blkfs $(MAKE) -C ../tools clean diff --git a/emul/forth/emul.fs b/emul/emul.fs similarity index 100% rename from emul/forth/emul.fs rename to emul/emul.fs diff --git a/emul/forth/forth.c b/emul/forth.c similarity index 99% rename from emul/forth/forth.c rename to emul/forth.c index 127a8ad..1629162 100644 --- a/emul/forth/forth.c +++ b/emul/forth.c @@ -2,7 +2,7 @@ #include #include #include -#include "../emul.h" +#include "emul.h" #include "forth1-bin.h" // in sync with glue.asm diff --git a/emul/forth/pre.fs b/emul/pre.fs similarity index 100% rename from emul/forth/pre.fs rename to emul/pre.fs diff --git a/emul/forth/run.fs b/emul/run.fs similarity index 100% rename from emul/forth/run.fs rename to emul/run.fs diff --git a/emul/forth/stage.c b/emul/stage.c similarity index 99% rename from emul/forth/stage.c rename to emul/stage.c index a3eb215..2e7d7ba 100644 --- a/emul/forth/stage.c +++ b/emul/stage.c @@ -1,7 +1,7 @@ #include #include #include -#include "../emul.h" +#include "emul.h" #ifdef STAGE2 #include "forth1-bin.h" #include "blkfs-bin.h" diff --git a/emul/forth/stop.fs b/emul/stop.fs similarity index 100% rename from emul/forth/stop.fs rename to emul/stop.fs diff --git a/emul/forth/xcomp.fs b/emul/xcomp.fs similarity index 100% rename from emul/forth/xcomp.fs rename to emul/xcomp.fs diff --git a/emul/forth/z80c.bin b/emul/z80c.bin similarity index 100% rename from emul/forth/z80c.bin rename to emul/z80c.bin diff --git a/recipes/rc2014/Makefile b/recipes/rc2014/Makefile index 480ab16..e53bdc8 100644 --- a/recipes/rc2014/Makefile +++ b/recipes/rc2014/Makefile @@ -1,7 +1,7 @@ TARGET = stage1.bin BASEDIR = ../.. FDIR = $(BASEDIR)/forth -EDIR = $(BASEDIR)/emul/forth +EDIR = $(BASEDIR)/emul STAGE2 = $(EDIR)/stage2 EMUL = $(BASEDIR)/emul/hw/rc2014/classic @@ -36,4 +36,3 @@ $(EMUL): .PHONY: emul emul: $(EMUL) $(TARGET) $(EMUL) $(TARGET) - diff --git a/recipes/rc2014/run.fs b/recipes/rc2014/run.fs index 5b26b59..73ab6a9 100644 --- a/recipes/rc2014/run.fs +++ b/recipes/rc2014/run.fs @@ -1,9 +1,7 @@ : (c<) KEY DUP EMIT ; -: INIT +: _ ACIA$ ." Collapse OS" CRLF ( 0c == CINPTR ) ['] (c<) 0x0c RAM+ ! -; -INIT - +; _ diff --git a/tests/Makefile b/tests/Makefile index 2842177..92d53ec 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -2,5 +2,5 @@ EMULDIR = ../emul .PHONY: run run: - $(MAKE) -C $(EMULDIR) forth/forth + $(MAKE) -C $(EMULDIR) all cd forth && ./runtests.sh diff --git a/tests/forth/runtests.sh b/tests/forth/runtests.sh index 08f861f..5e6ea0e 100755 --- a/tests/forth/runtests.sh +++ b/tests/forth/runtests.sh @@ -1,8 +1,7 @@ #!/bin/sh -e BASE=../.. -EXEC="${BASE}/emul/forth/forth" -FDIR="${BASE}/forth" +EXEC="${BASE}/emul/forth" TMP=$(mktemp) chk() {