Makefile 1.6 KB

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