all : sample0.xex \
	sample1.xex sample2.xex sample3.xex sample4.xex sample5.xex sample6.xex \
	fruit.xex mapclock.xex sailboat.xex sunset.xex train404.xex \
	potato.xex selfie.xex kitty.xex meme.xex

# sample5.s from sample5.jpg

# reminder: $< is input
#           $@ is output

%.s : %.jpg dither-image.js
	node dither-image.js $< $@

%.o : %.s
	ca65 -v -t atari -o $@ $<

%.xex : %.o dither4.o atari-asm-xex.cfg
	ld65 -v -C ./atari-asm-xex.cfg -o $@ dither4.o $<

clean :
	rm -f *.o
	rm -f *.s.png
	rm -f sample[0-9].s
	rm -f fruit.s mapclock.s sailboat.s sunset.s train404.s
	rm -f potato.s selfie.s kitty.s meme.s
	rm -f *.xex
