CC      = gcc
CFLAGS  = -O3 -m486 -fomit-frame-pointer -funroll-all-loops -msoft-float -ffast-math -DASM
LIB = -lalleg

xnes.exe : xnes.o nes.o m6502.o
	$(CC) -o xnes.exe xnes.o nes.o m6502.o $(CFLAGS) $(LIB)

m6502.o : m6502.c m6502.h tables.h codes.h
	gcc -c m6502.c $(CFLAGS)

nes.o : nes.c nes.h xnes.h pal.h
	gcc -c nes.c $(CFLAGS)

xnes.o : xnes.c xnes.h nes.h mmc.h
	gcc -c xnes.c $(CFLAGS)
