|
|
@@ -6,7 +6,7 @@ ZASMBIN = zasm/zasm |
|
|
|
AVRABIN = zasm/avra |
|
|
|
SHELLAPPS = zasm ed |
|
|
|
SHELLTGTS = ${SHELLAPPS:%=cfsin/%} |
|
|
|
BIN2C = ../tools/bin2c/bin2c |
|
|
|
BIN2C = ../tools/bin2c |
|
|
|
# Those Forth source files are in a particular order |
|
|
|
FORTHSRCS = core.fs str.fs parse.fs readln.fs fmt.fs z80a.fs |
|
|
|
FORTHSRC_PATHS = ${FORTHSRCS:%=../forth/%} |
|
|
@@ -15,17 +15,17 @@ OBJS = emul.o libz80/libz80.o |
|
|
|
SHELLOBJS = $(OBJS) $(CFSPACK_OBJ) |
|
|
|
ZASMOBJS = $(SHELLOBJS) |
|
|
|
|
|
|
|
.PHONY: all |
|
|
|
.PHONY: all tools |
|
|
|
all: $(TARGETS) $(AVRABIN) $(CFSIN_CONTENTS) |
|
|
|
|
|
|
|
$(BIN2C): ../tools/bin2c/bin2c.c |
|
|
|
$(MAKE) -C ../tools/bin2c |
|
|
|
tools: |
|
|
|
$(MAKE) -C ../tools |
|
|
|
|
|
|
|
# -o in sync with SHELL_CODE in shell/glue.asm |
|
|
|
shell/shell.bin: shell/glue.asm $(ZASMBIN) $(BIN2C) |
|
|
|
shell/shell.bin: shell/glue.asm $(ZASMBIN) tools |
|
|
|
$(ZASMBIN) $(KERNEL) shell/user.h $(APPS) < shell/glue.asm | tee $@ > /dev/null |
|
|
|
|
|
|
|
shell/shell-bin.h: shell/shell.bin $(BIN2C) |
|
|
|
shell/shell-bin.h: shell/shell.bin tools |
|
|
|
$(BIN2C) KERNEL < shell/shell.bin | tee $@ > /dev/null |
|
|
|
|
|
|
|
shell/shell: shell/shell.c $(SHELLOBJS) shell/shell-bin.h |
|
|
@@ -36,7 +36,7 @@ shell/shell: shell/shell.c $(SHELLOBJS) shell/shell-bin.h |
|
|
|
forth/forth0.bin: |
|
|
|
cat forth/boot.bin forth/z80c.bin > $@ |
|
|
|
|
|
|
|
forth/forth0-bin.h: forth/forth0.bin $(BIN2C) |
|
|
|
forth/forth0-bin.h: forth/forth0.bin tools |
|
|
|
$(BIN2C) KERNEL < forth/forth0.bin | tee $@ > /dev/null |
|
|
|
|
|
|
|
forth/stage1: forth/stage.c $(OBJS) forth/forth0-bin.h |
|
|
@@ -51,7 +51,7 @@ forth/core.bin: $(FORTHSRC_PATHS) forth/stage1 |
|
|
|
forth/forth1.bin: forth/forth0.bin forth/core.bin |
|
|
|
cat forth/forth0.bin forth/core.bin > $@ |
|
|
|
|
|
|
|
forth/forth1-bin.h: forth/forth1.bin $(BIN2C) |
|
|
|
forth/forth1-bin.h: forth/forth1.bin tools |
|
|
|
$(BIN2C) KERNEL < forth/forth1.bin | tee $@ > /dev/null |
|
|
|
|
|
|
|
forth/stage2: forth/stage.c $(OBJS) forth/forth1-bin.h |
|
|
@@ -60,10 +60,10 @@ forth/stage2: forth/stage.c $(OBJS) forth/forth1-bin.h |
|
|
|
forth/forth: forth/forth.c $(OBJS) forth/forth1-bin.h |
|
|
|
$(CC) forth/forth.c $(OBJS) -o $@ |
|
|
|
|
|
|
|
zasm/kernel-bin.h: zasm/kernel.bin $(BIN2C) |
|
|
|
zasm/kernel-bin.h: zasm/kernel.bin tools |
|
|
|
$(BIN2C) KERNEL < zasm/kernel.bin | tee $@ > /dev/null |
|
|
|
|
|
|
|
zasm/zasm-bin.h: zasm/zasm.bin $(BIN2C) |
|
|
|
zasm/zasm-bin.h: zasm/zasm.bin tools |
|
|
|
$(BIN2C) USERSPACE < zasm/zasm.bin | tee $@ > /dev/null |
|
|
|
|
|
|
|
$(ZASMBIN): zasm/zasm.c $(ZASMOBJS) zasm/kernel-bin.h zasm/zasm-bin.h |
|
|
@@ -72,7 +72,7 @@ $(ZASMBIN): zasm/zasm.c $(ZASMOBJS) zasm/kernel-bin.h zasm/zasm-bin.h |
|
|
|
zasm/avra.bin: $(ZASMBIN) |
|
|
|
$(ZASMBIN) $(KERNEL) $(APPS) zasm/user.h < $(APPS)/zasm/gluea.asm > $@ |
|
|
|
|
|
|
|
zasm/avra-bin.h: zasm/avra.bin $(BIN2C) |
|
|
|
zasm/avra-bin.h: zasm/avra.bin tools |
|
|
|
$(BIN2C) USERSPACE < zasm/avra.bin | tee $@ > /dev/null |
|
|
|
|
|
|
|
$(AVRABIN): zasm/zasm.c $(ZASMOBJS) zasm/kernel-bin.h zasm/avra-bin.h |
|
|
@@ -113,4 +113,4 @@ fbootstrap: forth/stage2 |
|
|
|
.PHONY: clean |
|
|
|
clean: |
|
|
|
rm -f $(TARGETS) $(SHELLTGTS) emul.o zasm/*-bin.h shell/*-bin.h |
|
|
|
$(MAKE) -C ../tools/bin2c clean |
|
|
|
$(MAKE) -C ../tools clean |