OBJECTS = write_fpga_config.bin

CA65 = ca65
LD65 = ld65

all: foxnrpc.lib

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

%.bin: %.s
	$(CA65) -DSERIAL_CMP=0xE0 -o temp_57600 -I ../routines/common $<
	$(LD65) -o temp_57600 -C ../routines/routine.cfg temp_57600
	$(CA65) -DSERIAL_CMP=0xE0 -DSERIAL_115200=1 -o temp_115200 -I ../routines/common $<
	$(LD65) -o temp_115200 -C ../routines/routine.cfg temp_115200
	cat temp_57600 temp_115200 > $*.bin
	
clean:
	-$(RM) *.bin
