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