Browse Source

Move /emul/forth/* to /emul

Less noisy this way
pull/102/head
Virgil Dupras 4 years ago
parent
commit
1bd191e86a
14 changed files with 39 additions and 42 deletions
  1. +7
    -6
      emul/.gitignore
  2. +25
    -25
      emul/Makefile
  3. +0
    -0
      emul/emul.fs
  4. +1
    -1
      emul/forth.c
  5. +0
    -0
      emul/pre.fs
  6. +0
    -0
      emul/run.fs
  7. +1
    -1
      emul/stage.c
  8. +0
    -0
      emul/stop.fs
  9. +0
    -0
      emul/xcomp.fs
  10. +0
    -0
      emul/z80c.bin
  11. +1
    -2
      recipes/rc2014/Makefile
  12. +2
    -4
      recipes/rc2014/run.fs
  13. +1
    -1
      tests/Makefile
  14. +1
    -2
      tests/forth/runtests.sh

+ 7
- 6
emul/.gitignore View File

@@ -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

+ 25
- 25
emul/Makefile View File

@@ -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

emul/forth/emul.fs → emul/emul.fs View File


emul/forth/forth.c → emul/forth.c View File

@@ -2,7 +2,7 @@
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include "../emul.h"
#include "emul.h"
#include "forth1-bin.h"

// in sync with glue.asm

emul/forth/pre.fs → emul/pre.fs View File


emul/forth/run.fs → emul/run.fs View File


emul/forth/stage.c → emul/stage.c View File

@@ -1,7 +1,7 @@
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include "../emul.h"
#include "emul.h"
#ifdef STAGE2
#include "forth1-bin.h"
#include "blkfs-bin.h"

emul/forth/stop.fs → emul/stop.fs View File


emul/forth/xcomp.fs → emul/xcomp.fs View File


emul/forth/z80c.bin → emul/z80c.bin View File


+ 1
- 2
recipes/rc2014/Makefile View File

@@ -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)

+ 2
- 4
recipes/rc2014/run.fs View File

@@ -1,9 +1,7 @@
: (c<) KEY DUP EMIT ;
: INIT
: _
ACIA$
." Collapse OS" CRLF
( 0c == CINPTR )
['] (c<) 0x0c RAM+ !
;
INIT

; _

+ 1
- 1
tests/Makefile View File

@@ -2,5 +2,5 @@ EMULDIR = ../emul

.PHONY: run
run:
$(MAKE) -C $(EMULDIR) forth/forth
$(MAKE) -C $(EMULDIR) all
cd forth && ./runtests.sh

+ 1
- 2
tests/forth/runtests.sh View File

@@ -1,8 +1,7 @@
#!/bin/sh -e

BASE=../..
EXEC="${BASE}/emul/forth/forth"
FDIR="${BASE}/forth"
EXEC="${BASE}/emul/forth"
TMP=$(mktemp)

chk() {


Loading…
Cancel
Save