1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 23:18:05 +11:00
collapseos/tools/emul/Makefile

53 lines
1.4 KiB
Makefile
Raw Normal View History

TARGETS = shell/shell zasm/zasm runbin/runbin
CFSPACK = ../cfspack/cfspack
KERNEL = ../../kernel
APPS = ../../apps
ZASMBIN = zasm/zasm
2019-05-10 04:09:40 +10:00
2019-05-10 02:58:41 +10:00
.PHONY: all
2019-05-10 04:09:40 +10:00
all: $(TARGETS)
2019-05-10 02:58:41 +10:00
shell/kernel.h: shell/shell_.asm $(ZASMBIN)
$(ZASMBIN) < $< | ./bin2c.sh KERNEL | tee $@ > /dev/null
zasm/kernel.h: zasm/kernel.bin
./bin2c.sh KERNEL < $< | tee $@ > /dev/null
zasm/user.h: zasm/zasm.bin
./bin2c.sh USERSPACE < $< | tee $@ > /dev/null
2019-05-10 02:58:41 +10:00
2019-05-18 10:47:43 +10:00
zasm/includes.cfs: $(CFSPACK)
rm -rf zasm/includes
cp -r $(KERNEL) zasm/includes
cp -r $(APPS)/zasm zasm/includes/zasm
find zasm/includes -name *.md -o -name *.example -o -name glue.asm -delete
find zasm/includes -type f -exec sed -i -e 's/;.*//g' {} \;
cp user.h zasm/includes
2019-05-17 21:23:59 +10:00
$(CFSPACK) zasm/includes > $@
rm -rf zasm/includes
2019-05-17 21:23:59 +10:00
zasm/includes.h: zasm/includes.cfs
2019-05-17 11:15:00 +10:00
./bin2c.sh FSDEV < $< | tee $@ > /dev/null
2019-05-17 21:23:59 +10:00
shell/shell: shell/shell.c libz80/libz80.o shell/kernel.h $(CFSPACK)
$(ZASMBIN): zasm/zasm.c libz80/libz80.o zasm/kernel.h zasm/user.h zasm/includes.h
runbin/runbin: runbin/runbin.c libz80/libz80.o
2019-05-10 04:09:40 +10:00
$(TARGETS):
2019-05-10 02:58:41 +10:00
cc $< libz80/libz80.o -o $@
libz80/libz80.o: libz80/z80.c
make -C libz80/codegen opcodes
gcc -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c
$(CFSPACK):
make -C ../cfspack
.PHONY: updatebootstrap
updatebootstrap: $(ZASMBIN)
$(ZASMBIN) < zasm/glue.asm > zasm/kernel.bin
$(ZASMBIN) < $(APPS)/zasm/glue.asm > zasm/zasm.bin
2019-05-10 02:58:41 +10:00
.PHONY: clean
clean:
rm -f $(TARGETS) zasm/{kernel,user}.h shell/kernel.h zasm/includes.*