
PLUGIN = libCDVDlinuz.so
CFLAGS+= -fPIC -Wall -O2 -fomit-frame-pointer -D__LINUX__ -D_LARGEFILE64_SOURCE
OBJECTS = misc.o buffer.o CD.o DVD.o device.o CDVD.o interface.o
LIBS = $(shell gtk-config --libs) -lpthread
CFLAGS+= $(shell gtk-config --cflags)
DEPS:= $(OBJS:.o=.d)

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 ${OBJECTS} ${DEPS} ${PLUGIN} *.d

%.o: %.c
	${CC} ${CFLAGS} -c -o $@ $< -MD -MF $(patsubst %.o,%.d,$@)

# -include ${DEPS}
