CC      = gcc
#INCDIR  = -I sndstretch
CFLAGS  = -Wall -O6 $(INCDIR)
#LDFLAGS = -lgthread -lpthread 
LDFLAGS = -gthread -pthread 

# maybe you will have to change this
XMMS_EPLUGIN_DIR = /usr/X11R6/lib/xmms/Output
XMMS_OPLUGIN_DIR = /usr/X11R6/lib/xmms/Effect

all: effect_plugin output_plugin

effect_plugin: sndstretch_xmms_eff.lo sndstretch.lo
	$(CC) -shared sndstretch_xmms_eff.lo sndstretch.lo `gtk-config --libs` $(LDFLAGS) -lc -o sndstretch_xmms_eff.so

output_plugin: sndstretch_xmms_out.lo sndstretch.lo
	$(CC) -shared sndstretch_xmms_out.lo sndstretch.lo `gtk-config --libs` $(LDFLAGS) -lc -o sndstretch_xmms_out.so

sndstretch_xmms_eff.lo: sndstretch_xmms.h sndstretch_xmms_eff.c sndstretch_xmms.c FB_logo.xpm sndstretch_xmms-logo.xpm
	$(CC) $(CFLAGS) -O2 -fPIC -c sndstretch_xmms_eff.c `gtk-config --cflags` -o sndstretch_xmms_eff.lo
        
sndstretch_xmms_out.lo: sndstretch_xmms.h sndstretch_xmms_out.c sndstretch_xmms.c FB_logo.xpm sndstretch_xmms-logo.xpm
	$(CC) $(CFLAGS) -O2 -fPIC -c sndstretch_xmms_out.c `gtk-config --cflags` -o sndstretch_xmms_out.lo
        
sndstretch.lo: sndstretch.c sndstretch.h
	$(CC) $(CFLAGS) -O2 -fPIC -c sndstretch.c -o sndstretch.lo

install:
	install sndstretch_xmms_out.so $(XMMS_OPLUGIN_DIR)
	install sndstretch_xmms_eff.so $(XMMS_EPLUGIN_DIR)
        
clean:
	rm -f *~ ; rm -f *.o ; rm -f *.so *.lo
