Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # This Makefile requires GNU Make or equivalent.
  2. include os.mk
  3. TARGET = abc80diag
  4. ASMFILES = $(TARGET:%=%.asm)
  5. CIMFILES = $(TARGET:%=%.cim)
  6. BDSFILES = $(TARGET:%=%.bds)
  7. BINFILES = $(TARGET:%=%.bin)
  8. HEXFILES = $(TARGET:%=%.hex)
  9. all: $(BINFILES)
  10. trs80m13diag.bin: inc/z80.mac inc/spt.mac inc/spt.asm inc/memtestmarch.asm inc/trs80m13con.asm inc/trs80music.asm Makefile os.mk
  11. trs80m2diag.bin: inc/z80.mac inc/spt.mac inc/spt.asm inc/memtestmarch.asm inc/trs80m2con.asm inc/trs80m2fdcboot.asm Makefile os.mk
  12. trs80m4pdiag.bin: inc/z80.mac inc/spt.mac inc/spt.asm inc/memtestmarch.asm inc/trs80m2con.asm Makefile os.mk
  13. .PHONY: clean realclean
  14. clean:
  15. -$(RM) $(wildcard $(BDSFILES) $(TARGET:%=%.txt) $(TARGET:%=%.lst))
  16. realclean: clean
  17. -$(RM) $(wildcard $(CIMFILES) $(BINFILES) $(HEXFILES))
  18. $(BDSFILES): %.bds: %.bin
  19. CDDD = truncate
  20. ASSEMBLE = $(ZMAC) --zmac -m --od . --oo cim,bds,lst,hex
  21. CDD = $(CDDD) -s 4096 abc80diag.bin
  22. %.bin: %.asm Makefile
  23. @-$(CECHO) $(SGR_COMMAND) $(ASSEMBLE) $< $(SGR_RESET)
  24. @-$(CECHON) $(SGR_OUTPUT)
  25. @$(ASSEMBLE) $<
  26. @-$(CECHON) $(SGR_RESET)
  27. @$(REN) $(<:%.asm=%.cim) $@
  28. @-$(CECHON) $(SGR_SIZE)
  29. @$(STAT) "%N: %z %Xz" $@
  30. @-$(CECHON) $(SGR_RESET)
  31. @$(CDD)
  32. .PHONY: emu
  33. MODEL = -m3
  34. # MEM = 32
  35. EMUFLAGS = $(MODEL) $(foreach h,$(HD),-h $(h)) $(foreach m,$(MEM),-mem $(m)) -turbo
  36. # EMUFLAGS = $(MODEL) $(foreach h,$(HD),-h $(h)) $(foreach m,$(MEM),-mem $(m))
  37. emu emu1 emu1l emu3: trs80m13diag.emu
  38. emu2 emu12 emu16 emu6k: trs80m2diag.emu
  39. emu4p: trs80m4pdiag.emu
  40. emu1: MODEL = -m1 -nlc -nld
  41. emu1l: MODEL = -m1
  42. emu3: MODEL = -m3
  43. emu2: MODEL = -m2
  44. emu2: HD = ~/w/trs80/trs80-hard-disk-0.hdv
  45. emu12: MODEL = -m12
  46. emu16: MODEL = -m16
  47. emu6k: MODEL = -m6000
  48. # emu4: MODEL = -m4
  49. emu4p: MODEL = -m4p
  50. # emu4d: MODEL = -m4d
  51. BREAKFLAGS=$(foreach brk,$(B),-b $(brk))
  52. %.emu: %.bds %.bin
  53. $(EMU) -ee -vol 20 -rand $(EMUFLAGS) $(BREAKFLAGS) -rom $*.bin -ls $*.bds $(E)
  54. .DEFAULT: all
  55. .PHONY: all