OBJECTS = fill_mem.bin fill_ppu.bin\
          nrpc_boot.bin nrpc_boot_pal.bin\
          read_crc.bin\
          read_mem.bin read_ppu.bin\
          write_mmc1.bin\
          write_ppu.bin

CA65 = ~/usr/bin/ca65
LD65 = ~/usr/bin/ld65

all: nrpc.lib cycle_colors.bin

nrpc.lib: ${OBJECTS}
	cat ${OBJECTS} > nrpc.lib

%.bin: %.s
	$(CA65) -I common -o temp_57600 $<
	$(LD65) -C routine.cfg -o temp_57600 temp_57600
	$(CA65) -I common -o -DSERIAL_115200=1 temp_115200 $<
	$(LD65) -C routine.cfg -o temp_115200 temp_115200
	cat temp_57600 temp_115200 > $*.bin

clean:
	-$(RM) *.bin
