1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-27 07:28:06 +11:00
collapseos/emul/Makefile
2020-06-24 23:11:43 +03:00

49 lines
960 B
Makefile

TARGETS = forth stage
OBJS = emul.o libz80/libz80.o
BLKPACK = ../tools/blkpack
BLKUNPACK = ../tools/blkunpack
CFLAGS = -g -Wall
.PHONY: all
all: $(TARGETS)
$(BLKPACK):
$(MAKE) -C ../tools
.PHONY: $(BLKUNPACK)
$(BLKUNPACK): $(BLKPACK)
stage: stage.c $(OBJS) blkfs
$(CC) $(CFLAGS) stage.c $(OBJS) -o $@
blkfs: $(BLKPACK)
$(BLKPACK) ../blk > $@
forth: forth.c $(OBJS) blkfs
$(CC) $(CFLAGS) forth.c $(OBJS) -lncurses -o $@
libz80/libz80.o: libz80/z80.c
$(MAKE) -C libz80/codegen opcodes
$(CC) $(CFLAGS) -ansi -c -o libz80/libz80.o libz80/z80.c
emul.o: emul.c
$(CC) $(CFLAGS) -DFBIN_PATH=\"`pwd`/forth.bin\" -DBLKFS_PATH=\"`pwd`/blkfs\" -c -o emul.o emul.c
.PHONY: updatebootstrap
updatebootstrap: stage xcomp.fs pack
./stage < xcomp.fs > new.bin
mv new.bin forth.bin
.PHONY: pack
pack:
rm blkfs && $(MAKE) blkfs
.PHONY: unpack
unpack:
$(BLKUNPACK) ../blk < blkfs
.PHONY: clean
clean:
rm -f $(TARGETS) emul.o *-bin.h blkfs libz80/libz80.o