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.

68 lines
1.3KB

  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.h: $(BIN2C)
  14. $(BIN2C) KERNEL < stage0.bin > $@
  15. stage1: stage.c $(OBJS) stage0-bin.h
  16. $(CC) stage.c $(OBJS) -o $@
  17. stage1dbg: stage.c $(OBJS) stage0-bin.h
  18. $(CC) -DDEBUG stage.c $(OBJS) -o $@
  19. stage1.bin: stage1.fs stage1
  20. ./stage1 < stage1.fs > $@
  21. stage1-bin.h: stage1.bin $(BIN2C)
  22. $(BIN2C) KERNEL < stage1.bin > $@
  23. stage2: stage.c $(OBJS) stage1-bin.h blkfs-bin.h
  24. $(CC) -DSTAGE2 stage.c $(OBJS) -o $@
  25. blkfs: $(BLKPACK)
  26. $(BLKPACK) ../blk > $@
  27. blkfs-bin.h: blkfs $(BIN2C)
  28. $(BIN2C) BLKFS < blkfs > $@
  29. forth: forth.c $(OBJS) stage1-bin.h blkfs-bin.h
  30. $(CC) forth.c $(OBJS) -o $@
  31. libz80/libz80.o: libz80/z80.c
  32. $(MAKE) -C libz80/codegen opcodes
  33. $(CC) -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c
  34. emul.o: emul.c
  35. $(CC) -c -o emul.o emul.c
  36. .PHONY: updatebootstrap
  37. updatebootstrap: stage2
  38. cat xcomp.fs | ./stage2 > stage0.bin
  39. .PHONY: pack
  40. pack:
  41. rm blkfs && $(MAKE) blkfs
  42. .PHONY: unpack
  43. unpack:
  44. $(BLKUNPACK) ../blk < blkfs
  45. .PHONY: clean
  46. clean:
  47. rm -f $(TARGETS) emul.o *-bin.h stage{1,2}.bin blkfs
  48. $(MAKE) -C ../tools clean