CFLAGS+= -fPIC -Wall -O2 -fomit-frame-pointer -D__LINUX__

all: pthreadtest.exe buffertest.exe devicetest.exe librarytest.exe

pthreadtest.exe: pthreadtest.c
	gcc ${CFLAGS} -o pthreadtest.exe pthreadtest.c ../src/misc.o -lpthread
	strip --strip-unneeded --strip-debug pthreadtest.exe

buffertest.exe: buffertest.c
	gcc ${CFLAGS} -o buffertest.exe buffertest.c ../src/buffer.o
	strip --strip-unneeded --strip-debug buffertest.exe

devicetest.exe: devicetest.c
	gcc ${CFLAGS} -o devicetest.exe devicetest.c ../src/misc.o ../src/buffer.o ../src/CD.o ../src/DVD.o ../src/device.o
	strip --strip-unneeded --strip-debug devicetest.exe

librarytest.exe: librarytest.c
	gcc ${CFLAGS} -o librarytest.exe librarytest.c -lpthread -ldl
	strip --strip-unneeded --strip-debug librarytest.exe

clean: 
	rm -f *.exe *.o *~

