Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # SDK Config
  2. PLATFORM=mac
  3. ifeq ($(PLATFORM),linux)
  4. # Linux Wine
  5. SDK=/home/david/.wine/drive_c/65xx_FreeSDK
  6. WINE=wine
  7. EMU=zsnes
  8. EMU_DEBUG=/home/david/Devel/arch/snes/tools/zsnes_linux_debug151/src/zsnesd -d
  9. else
  10. # Mac Wine
  11. SDK=/Users/david/.wine/drive_c/65xx_FreeSDK
  12. WINE=wine
  13. EMU=zsnes
  14. endif
  15. CC=$(WINE) $(SDK)/bin/WDC816CC.exe
  16. AS=$(WINE) $(SDK)/bin/WDC816AS.exe
  17. LD=$(WINE) $(SDK)/bin/WDCLN.exe
  18. PADBIN=$(WINE) tools/padbin.exe
  19. PCX2SNES=$(WINE) tools/Pcx2Snes.exe
  20. # Project
  21. INC=$(SDK)/include
  22. LIBS=$(SDK)/lib/cc
  23. #OBJS=StartupSnes.obj main.obj pad.obj event.obj myEvents.obj PPU.obj debug.obj ressource.obj
  24. OBJS=StartupSnes.obj main.obj pad.obj PPU.obj debug.obj ressource.obj crc.obj
  25. APP=crc.smc
  26. GFX=kungfu debugfont
  27. all: $(APP)
  28. run:
  29. $(EMU) $(APP)
  30. debugger:
  31. $(EMU_DEBUG) $(APP)
  32. check:
  33. ucon64 -chk $(APP)
  34. upload:
  35. ucon64 -chk $(APP)
  36. cp -rv $(APP) /Volumes/SNES
  37. sync
  38. diskutil unmount /Volumes/SNES
  39. rand:
  40. dd if=/dev/urandom of=tmp.rand bs=32k count=6
  41. dd if=$(APP) of=tmp.app bs=32k count=2
  42. cat tmp.app tmp.rand > $(APP)
  43. rm tmp.rand tmp.app
  44. ucon64 -chk $(APP)
  45. rand16:
  46. dd if=/dev/urandom of=tmp.rand bs=32k count=14
  47. dd if=$(APP) of=tmp.app bs=32k count=2
  48. cat tmp.app tmp.rand > $(APP)
  49. rm tmp.rand tmp.app
  50. ucon64 -chk $(APP)
  51. crc:
  52. python ../../scripts/crc_xmodem.py $(APP)
  53. kungfu:
  54. $(PCX2SNES) ressource/kungfu -n -c16 -screen
  55. debugfont:
  56. $(PCX2SNES) ressource/debugFont -n -c16 -s8 -o1
  57. StartupSnes.obj: StartupSnes.asm
  58. $(AS) -V $?
  59. ressource.obj: ressource.asm
  60. $(AS) -V $?
  61. %.obj: %.c
  62. $(CC) -wl -wp -sop -MC -I $(INC) $?
  63. $(APP): $(OBJS)
  64. $(LD) -HB -M21 -V -T -Pff \
  65. -C008000,0000 -U0000,0000 \
  66. -Avectors=FFE4,7FE4 \
  67. -Aregistration_data=FFB0,7FB0 \
  68. -Aressource=38000,8000 \
  69. -N $(OBJS) -L$(LIBS) -O $@
  70. $(PADBIN) 0x100000 $(APP)
  71. clean:
  72. rm -vf $(APP) *.obj