
VERSION = 0
BUILD = 3
PLUGIN = libCDVDlinuz-${VERSION}.${BUILD}.so
CFLAGS+= -fPIC -Wall -O2 -fomit-frame-pointer -D__LINUX__
OBJECTS = CDVD.o interface.o support.o
LIBS = $(shell gtk-config --libs) 
CFLAGS+= $(shell gtk-config --cflags) -DVERSION=${VERSION} -DBUILD=${BUILD}

all: plugin

plugin: ${OBJECTS}
	rm -f ${PLUGIN}
	gcc -shared -Wl,-soname,${PLUGIN} ${CFLAGS} ${OBJECTS} -o ${PLUGIN} ${LIBS}
	strip --strip-unneeded --strip-debug ${PLUGIN}

clean: 
	rm -f *.o *.so

# Dependencies

CDVD.o: CDVD.c CDVD.h PS2Edefs.h PS2Etypes.h interface.h support.h
callbacks.o: callbacks.c callbacks.h interface.h support.h
interface.o: interface.c callbacks.h interface.h support.h
support.o: support.c support.h
