.PHONY : clean all

all : mandel.xex

mandel.xex : mandel.o mandel-core.o tables.o atari-xex.cfg
	ld65 -C ./atari-xex.cfg --mapfile mandel.map -o $@ mandel.o mandel-core.o tables.o atari.lib

mandel.s : mandel.c mandel.h
	cc65 -o $@ mandel.c

%.o : %.s
	ca65 -o $@ $<

tables.s : tables.js
	node tables.js > tables.s

clean :
	rm -f tables.s
	rm -f mandel.s
	rm -f *.o
	rm -f *.xex
	rm -f mandel.map
