CC = gcc
#CFLAGS = -g -O3 -fomit-frame-pointer -funroll-loops -ffast-math -mcpu=athlon `gtk-config --cflags` -DUSE_GTK -Wall `sdl-config --cflags` -lm `sdl-config --libs`
CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -ffast-math -mcpu=athlon `gtk-config --cflags` -DUSE_GTK -Wall `sdl-config --cflags`

#CFLAGS = -g -O3 -fomit-frame-pointer -funroll-loops -ffast-math -mcpu=athlon `gtk-config --cflags` -DUSE_GTK -Wall

LD = gcc
LDFLAGS = -shared -Wl,-Bsymbolic `gtk-config --libs` -lpthread -lm `sdl-config --libs`

OBJECTS	=	main.o

all: jttl_audio.so instructions

jttl_audio.so: $(OBJECTS)
	$(LD) $(LDFLAGS) -o $@ $(OBJECTS)
	strip --strip-all $@

instructions:
	$(warning please copy jttl_audio.so in the plugins/ folder of the emulator)
	$(warning and copy jttl_audio.conf to emulator's root directory)

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

clean:
	rm -rf jttl_audio.so $(OBJECTS)

rebuild: clean all
