collapseos/emul/Makefile

72 lines
2.0 KiB
Makefile
Raw Normal View History

2019-12-31 13:32:09 -05:00
CFSPACK = ../tools/cfspack/cfspack
TARGETS = shell/shell zasm/zasm runbin/runbin
2019-12-31 13:32:09 -05:00
KERNEL = ../kernel
APPS = ../apps
ZASMBIN = zasm/zasm
2019-12-13 17:38:40 -05:00
AVRABIN = zasm/avra
2019-12-31 13:32:09 -05:00
ZASMSH = ./zasm.sh
SHELLAPPS = zasm ed
SHELLTGTS = ${SHELLAPPS:%=cfsin/%}
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-12-13 17:38:40 -05:00
all: $(TARGETS) $(AVRABIN) $(CFSIN_CONTENTS)
2019-05-09 12:58:41 -04:00
# -o in sync with SHELL_CODE in shell/glue.asm
shell/shell.bin: shell/glue.asm $(ZASMBIN)
$(ZASMSH) $(KERNEL) shell/user.h $(APPS) < shell/glue.asm | tee $@ > /dev/null
shell/shell-bin.h: shell/shell.bin
./bin2c.sh KERNEL < shell/shell.bin | tee $@ > /dev/null
2019-12-13 17:38:40 -05:00
shell/shell: shell/shell.c $(OBJS) shell/shell-bin.h
$(CC) shell/shell.c $(OBJS) -o $@
zasm/kernel-bin.h: zasm/kernel.bin
./bin2c.sh KERNEL < zasm/kernel.bin | tee $@ > /dev/null
zasm/zasm-bin.h: zasm/zasm.bin
./bin2c.sh USERSPACE < zasm/zasm.bin | tee $@ > /dev/null
2019-05-09 12:58:41 -04:00
$(ZASMBIN): zasm/zasm.c $(OBJS) zasm/kernel-bin.h zasm/zasm-bin.h $(CFSPACK)
$(CC) zasm/zasm.c $(OBJS) -o $@
2019-12-13 17:38:40 -05:00
zasm/avra.bin: $(ZASMBIN)
$(ZASMSH) $(KERNEL) $(APPS) zasm/user.h < $(APPS)/zasm/gluea.asm > $@
zasm/avra-bin.h: zasm/avra.bin
./bin2c.sh USERSPACE < zasm/avra.bin | tee $@ > /dev/null
$(AVRABIN): zasm/zasm.c $(OBJS) zasm/kernel-bin.h zasm/avra-bin.h
$(CC) -D AVRA 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
emul.o: emul.c
$(CC) -c -o emul.o emul.c
$(CFSPACK):
2019-12-31 13:32:09 -05:00
$(MAKE) -C ../tools/cfspack
# -o in sync with USER_CODE in shell/user.h
$(SHELLTGTS): $(ZASMBIN)
$(ZASMSH) -o 42 $(KERNEL) $(APPS) shell/user.h < $(APPS)/${@:cfsin/%=%}/glue.asm > $@
cfsin/user.h: shell/user.h
cp shell/user.h $@
.PHONY: updatebootstrap
2019-12-13 17:38:40 -05:00
updatebootstrap: $(ZASMBIN)
$(ZASMSH) $(KERNEL) < zasm/glue.asm > zasm/kernel.bin
$(ZASMSH) $(KERNEL) $(APPS) zasm/user.h < $(APPS)/zasm/glue.asm > zasm/zasm.bin
2019-05-09 12:58:41 -04:00
.PHONY: clean
clean:
rm -f $(TARGETS) $(SHELLTGTS) emul.o zasm/*-bin.h shell/*-bin.h