INCLUDE=-I./include -I/usr/include/SDL
LIBS=-lm -lSDL

CC=gcc -s -O2 -fomit-frame-pointer

COMMON_HEADERS=include/emuversion.h include/debug.h include/video/colors.h
ALL=emu65el02

all: $(ALL)

release: $(ALL)

emu65el02: emu65el02.o src/emubase.o src/memory/memory.o src/video/gbuffer.o src/debug.o src/cpu/65el02.o src/display/display.o src/drive/drive.o src/options.o src/monitor.o src/calc.o src/screen.o
	$(CC) $^ -o $@ $(LIBS)

%.o: %.c $(COMMON_HEADERS)

.c.o:
	$(CC) $(INCLUDE) -c $< -o $@

clean:
	rm -f *~ *.o core *.stackdump src/*.o
	/bin/find ./src -iname '*.o' -exec rm {} \;

distclean:
	rm -f *~ *.o core *.stackdump emu65el02.exe
	/bin/find ./src -iname '*.o' -exec rm {} \;
