Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.4KB

  1. TARGETS = forth stage2
  2. OBJS = emul.o libz80/libz80.o
  3. BIN2C = ../tools/bin2c
  4. BLKPACK = ../tools/blkpack
  5. BLKUNPACK = ../tools/blkunpack
  6. .PHONY: all
  7. all: $(TARGETS)
  8. $(BLKPACK):
  9. $(MAKE) -C ../tools
  10. .PHONY: $(BIN2C) $(BLKUNPACK)
  11. $(BIN2C): $(BLKPACK)
  12. $(BLKUNPACK): $(BLKPACK)
  13. stage0.bin: stage2 xcomp.fs
  14. cat xcomp.fs | ./stage2 > stage0.bin
  15. stage0-bin.h: stage0.bin $(BIN2C)
  16. $(BIN2C) KERNEL < stage0.bin > $@
  17. stage1: stage.c $(OBJS) stage0-bin.h
  18. $(CC) stage.c $(OBJS) -o $@
  19. stage1dbg: stage.c $(OBJS) stage0-bin.h
  20. $(CC) -DDEBUG stage.c $(OBJS) -o $@
  21. # not dependent on forth.bin to avoid circular deps.
  22. forth-bin.h: $(BIN2C)
  23. $(BIN2C) KERNEL < forth.bin > $@
  24. stage2: stage.c $(OBJS) forth-bin.h blkfs-bin.h
  25. $(CC) -DSTAGE2 stage.c $(OBJS) -o $@
  26. blkfs: $(BLKPACK)
  27. $(BLKPACK) ../blk > $@
  28. blkfs-bin.h: blkfs $(BIN2C)
  29. $(BIN2C) BLKFS < blkfs > $@
  30. forth: forth.c $(OBJS) forth-bin.h blkfs-bin.h
  31. $(CC) forth.c $(OBJS) -o $@
  32. libz80/libz80.o: libz80/z80.c
  33. $(MAKE) -C libz80/codegen opcodes
  34. $(CC) -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c
  35. emul.o: emul.c
  36. $(CC) -c -o emul.o emul.c
  37. .PHONY: updatebootstrap
  38. updatebootstrap: stage1 stage1.fs
  39. ./stage1 < stage1.fs > forth.bin
  40. .PHONY: pack
  41. pack:
  42. rm blkfs && $(MAKE) blkfs
  43. .PHONY: unpack
  44. unpack:
  45. $(BLKUNPACK) ../blk < blkfs
  46. .PHONY: clean
  47. clean:
  48. rm -f $(TARGETS) emul.o *-bin.h stage{1,2}.bin blkfs
  49. $(MAKE) -C ../tools clean