2019-05-16 12:07:57 -04:00
|
|
|
CFSPACK = ../cfspack/cfspack
|
2019-11-24 10:24:15 -05:00
|
|
|
TARGETS = shell/shell bshell/shell zasm/zasm runbin/runbin
|
2019-05-19 11:19:41 -04:00
|
|
|
KERNEL = ../../kernel
|
2019-05-19 09:14:40 -04:00
|
|
|
APPS = ../../apps
|
2019-05-19 15:03:34 -04:00
|
|
|
ZASMBIN = zasm/zasm
|
2019-06-02 19:54:37 -04:00
|
|
|
ZASMSH = ../zasm.sh
|
2019-12-09 09:36:38 -05:00
|
|
|
SHELLAPPS = zasm ed
|
2019-12-11 13:01:51 -05:00
|
|
|
SHELLTGTS = ${SHELLAPPS:%=cfsin/%}
|
2019-12-09 09:36:38 -05:00
|
|
|
CFSIN_CONTENTS = $(SHELLTGTS) cfsin/user.h
|
|
|
|
OBJS = emul.o libz80/libz80.o
|
2019-05-09 14:09:40 -04:00
|
|
|
|
2019-05-09 12:58:41 -04:00
|
|
|
.PHONY: all
|
2019-06-03 09:25:47 -04:00
|
|
|
all: $(TARGETS) $(CFSIN_CONTENTS)
|
2019-05-09 12:58:41 -04:00
|
|
|
|
2019-11-15 15:37:49 -05:00
|
|
|
# -o in sync with SHELL_CODE in shell/glue.asm
|
|
|
|
shell/shell.bin: $(APPS)/shell/glue.asm $(ZASMBIN)
|
2019-12-09 09:36:38 -05:00
|
|
|
$(ZASMSH) -o 07 $(KERNEL) shell/user.h $(APPS) < $(APPS)/shell/glue.asm | tee $@ > /dev/null
|
2019-11-15 15:37:49 -05:00
|
|
|
|
|
|
|
shell/kernel-bin.h: shell/glue.asm shell/shell.bin $(ZASMBIN)
|
2019-12-09 09:36:38 -05:00
|
|
|
$(ZASMSH) $(KERNEL) shell/shell.bin < shell/glue.asm | ./bin2c.sh KERNEL | tee $@ > /dev/null
|
2019-05-19 12:57:59 -04:00
|
|
|
|
2019-11-24 10:24:15 -05:00
|
|
|
bshell/shell.bin: bshell/glue.asm $(ZASMBIN)
|
2019-12-09 09:36:38 -05:00
|
|
|
$(ZASMSH) $(KERNEL) bshell/user.h $(APPS) < bshell/glue.asm | tee $@ > /dev/null
|
2019-11-24 10:24:15 -05:00
|
|
|
|
|
|
|
bshell/shell-bin.h: bshell/shell.bin
|
2019-12-09 09:36:38 -05:00
|
|
|
./bin2c.sh KERNEL < bshell/shell.bin | tee $@ > /dev/null
|
2019-11-24 10:24:15 -05:00
|
|
|
|
2019-06-03 08:12:44 -04:00
|
|
|
zasm/kernel-bin.h: zasm/kernel.bin
|
2019-12-09 09:36:38 -05:00
|
|
|
./bin2c.sh KERNEL < zasm/kernel.bin | tee $@ > /dev/null
|
2019-05-19 15:03:34 -04:00
|
|
|
|
2019-06-03 08:12:44 -04:00
|
|
|
zasm/zasm-bin.h: zasm/zasm.bin
|
2019-12-09 09:36:38 -05:00
|
|
|
./bin2c.sh USERSPACE < zasm/zasm.bin | tee $@ > /dev/null
|
2019-05-09 12:58:41 -04:00
|
|
|
|
2019-12-09 09:36:38 -05:00
|
|
|
shell/shell: shell/shell.c $(OBJS) shell/kernel-bin.h
|
|
|
|
$(CC) shell/shell.c $(OBJS) -o $@
|
|
|
|
|
|
|
|
bshell/shell: bshell/shell.c $(OBJS) bshell/shell-bin.h
|
|
|
|
$(CC) bshell/shell.c $(OBJS) -o $@
|
|
|
|
|
|
|
|
$(ZASMBIN): zasm/zasm.c $(OBJS) zasm/kernel-bin.h zasm/zasm-bin.h $(CFSPACK)
|
|
|
|
$(CC) zasm/zasm.c $(OBJS) -o $@
|
|
|
|
|
|
|
|
runbin/runbin: runbin/runbin.c $(OBJS)
|
|
|
|
$(CC) runbin/runbin.c $(OBJS) -o $@
|
2019-05-09 12:58:41 -04:00
|
|
|
|
|
|
|
libz80/libz80.o: libz80/z80.c
|
2019-07-11 21:21:54 -04:00
|
|
|
$(MAKE) -C libz80/codegen opcodes
|
2019-05-20 08:20:00 -04:00
|
|
|
$(CC) -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c
|
2019-05-09 12:58:41 -04:00
|
|
|
|
2019-12-02 16:35:49 -05:00
|
|
|
emul.o: emul.c
|
|
|
|
$(CC) -c -o emul.o emul.c
|
|
|
|
|
2019-05-16 12:07:57 -04:00
|
|
|
$(CFSPACK):
|
2019-07-11 21:21:54 -04:00
|
|
|
$(MAKE) -C ../cfspack
|
2019-05-12 11:20:31 -04:00
|
|
|
|
2019-11-15 15:37:49 -05:00
|
|
|
# -o in sync with USER_CODE in shell/user.h
|
2019-12-09 09:36:38 -05:00
|
|
|
$(SHELLTGTS): $(ZASMBIN)
|
2019-12-11 13:01:51 -05:00
|
|
|
$(ZASMSH) -o 42 $(KERNEL) $(APPS) shell/user.h < $(APPS)/${@:cfsin/%=%}/glue.asm > $@
|
2019-06-03 08:32:25 -04:00
|
|
|
|
2019-06-03 09:25:47 -04:00
|
|
|
cfsin/user.h: shell/user.h
|
2019-12-09 09:36:38 -05:00
|
|
|
cp shell/user.h $@
|
2019-06-03 09:25:47 -04:00
|
|
|
|
2019-05-19 15:03:34 -04:00
|
|
|
.PHONY: updatebootstrap
|
2019-06-02 15:50:59 -04:00
|
|
|
updatebootstrap: $(ZASMBIN) $(INCCFS)
|
2019-06-02 19:54:37 -04:00
|
|
|
$(ZASMSH) $(KERNEL) < zasm/glue.asm > zasm/kernel.bin
|
2019-06-03 08:12:44 -04:00
|
|
|
$(ZASMSH) $(KERNEL) $(APPS) zasm/user.h < $(APPS)/zasm/glue.asm > zasm/zasm.bin
|
2019-05-19 15:03:34 -04:00
|
|
|
|
2019-05-09 12:58:41 -04:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2019-12-09 09:36:38 -05:00
|
|
|
rm -f $(TARGETS) $(SHELLTGTS) emul.o zasm/*-bin.h shell/*-bin.h
|