Makefile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. CC = sdcc
  2. CFLAGS= -mz80 --code-loc 42513 --no-std-crt0 --data-loc 0 --reserve-regs-iy --max-allocs-per-node 100000
  3. all: main.8xp testvar.8xv
  4. main.8xp: main.bin
  5. binpac8x -O CSYSCALL main.bin main.8xp
  6. main.bin: main.ixh
  7. objcopy -Iihex -Obinary main.ihx main.bin
  8. main.ixh: main.rel syscalls.rel crt0.rel
  9. $(CC) $(CFLAGS) main.rel syscalls.rel crt0.rel
  10. main.rel: main.c syscalls.h
  11. $(CC) $(CFLAGS) -c main.c
  12. syscalls.rel: syscalls.c syscalls.h
  13. $(CC) $(CFLAGS) -c syscalls.c
  14. crt0.rel: crt0.s
  15. sdasz80 -p -g -o crt0.rel crt0.s
  16. testvar.8xv: testvar.dat.rgb565.rle
  17. to8xv -a -o testvar.8xv testvar.dat.rgb565.rle TESTVAR
  18. reimu.ppm:
  19. wget https://tomli.blog/ftp/IT/reimu.ppm -O reimu.ppm
  20. testvar.dat: reimu.ppm
  21. sed '1d; 2d; 3d; 4d' reimu.ppm > testvar.dat
  22. testvar.dat.rgb565: testvar.dat
  23. $(MAKE) -C tools
  24. ./tools/1-rgb565 testvar.dat
  25. testvar.dat.rgb565.rle: testvar.dat.rgb565
  26. ./tools/2-rle testvar.dat.rgb565
  27. clean:
  28. $(MAKE) clean -C tools
  29. rm -rf *.bin *.8xp *.rel *.ihx *.lk *.lst *.sym *.map *.noi main.asm syscalls.asm syscalls.ihx testvar.8xv testvar.dat.*