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.

57 lines
1.1KB

  1. TARGETS = forth stage
  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. # not dependent on forth.bin to avoid circular deps.
  14. forth-bin.h: $(BIN2C)
  15. $(BIN2C) KERNEL < forth.bin > $@
  16. stage: stage.c $(OBJS) forth-bin.h blkfs-bin.h
  17. $(CC) stage.c $(OBJS) -o $@
  18. blkfs: $(BLKPACK)
  19. $(BLKPACK) ../blk > $@
  20. blkfs-bin.h: blkfs $(BIN2C)
  21. $(BIN2C) BLKFS < blkfs > $@
  22. forth: forth.c $(OBJS) forth-bin.h blkfs-bin.h
  23. $(CC) forth.c $(OBJS) -o $@
  24. libz80/libz80.o: libz80/z80.c
  25. $(MAKE) -C libz80/codegen opcodes
  26. $(CC) -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c
  27. emul.o: emul.c
  28. $(CC) -c -o emul.o emul.c
  29. .PHONY: updatebootstrap
  30. updatebootstrap: stage xcomp.fs
  31. ./stage < xcomp.fs > forth.bin
  32. .PHONY: pack
  33. pack:
  34. rm blkfs && $(MAKE) blkfs
  35. .PHONY: unpack
  36. unpack:
  37. $(BLKUNPACK) ../blk < blkfs
  38. .PHONY: clean
  39. clean:
  40. rm -f $(TARGETS) emul.o *-bin.h stage{1,2}.bin blkfs
  41. $(MAKE) -C ../tools clean