1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-28 03:28:07 +11:00
collapseos/tools/emul/Makefile

49 lines
1.3 KiB
Makefile
Raw Normal View History

CFSPACK = ../cfspack/cfspack
TARGETS = shell/shell zasm/zasm runbin/runbin
KERNEL = ../../kernel
APPS = ../../apps
ZASMBIN = zasm/zasm
ZASMSH = ../zasm.sh
2019-07-13 23:57:37 +10:00
SHELLAPPS = $(addprefix cfsin/, zasm ed)
CFSIN_CONTENTS = $(SHELLAPPS) cfsin/user.h
2019-05-10 04:09:40 +10:00
2019-05-10 02:58:41 +10:00
.PHONY: all
all: $(TARGETS) $(CFSIN_CONTENTS)
2019-05-10 02:58:41 +10:00
shell/kernel-bin.h: shell/shell_.asm $(ZASMBIN)
$(ZASMSH) $(KERNEL) < $< | ./bin2c.sh KERNEL | tee $@ > /dev/null
zasm/kernel-bin.h: zasm/kernel.bin
./bin2c.sh KERNEL < $< | tee $@ > /dev/null
zasm/zasm-bin.h: zasm/zasm.bin
./bin2c.sh USERSPACE < $< | tee $@ > /dev/null
2019-05-10 02:58:41 +10:00
shell/shell: shell/shell.c libz80/libz80.o shell/kernel-bin.h
$(ZASMBIN): zasm/zasm.c libz80/libz80.o zasm/kernel-bin.h zasm/zasm-bin.h $(CFSPACK)
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
$(CFSPACK):
2019-07-12 11:21:54 +10:00
$(MAKE) -C ../cfspack
$(SHELLAPPS): $(ZASMBIN)
$(ZASMSH) $(KERNEL) $(APPS) shell/user.h < $(APPS)/$(notdir $@)/glue.asm > $@
cfsin/user.h: shell/user.h
cp $< $@
.PHONY: updatebootstrap
updatebootstrap: $(ZASMBIN) $(INCCFS)
$(ZASMSH) $(KERNEL) < zasm/glue.asm > zasm/kernel.bin
$(ZASMSH) $(KERNEL) $(APPS) zasm/user.h < $(APPS)/zasm/glue.asm > zasm/zasm.bin
2019-05-10 02:58:41 +10:00
.PHONY: clean
clean:
rm -f $(TARGETS) $(SHELLAPPS) {zasm,shell}/*-bin.h