CFLAGS = -Wall -O2 -D_FILE_OFFSET_BITS=64

imp: main.o ringbuffer.o mpeg2.o handler.o crc32.o status.o playlist.o
	 gcc $(CFLAGS) main.o ringbuffer.o mpeg2.o handler.o crc32.o status.o playlist.o -lraw1394 -lavc1394 -liec61883 -pthread -o imp

main.o: main.c ringbuffer.h mpeg2.h handler.h status.h status.c playlist.c playlist.h
	gcc -c $(CFLAGS) main.c

ringbuffer.o: ringbuffer.c ringbuffer.h crc32.c crc32.h status.h status.c
	gcc -c $(CFLAGS) ringbuffer.c

mpeg2.o: mpeg2.c mpeg2.h status.h status.c playlist.c playlist.h
	gcc -c $(CFLAGS) mpeg2.c

handler.o: handler.c handler.h status.h status.c
	gcc -c $(CFLAGS) handler.c

crc32.o: crc32.c crc32.h
	gcc -c $(CFLAGS) crc32.c

status.o: status.h status.c
	gcc -c $(CFLAGS) status.c

playlist.o: playlist.c playlist.h
	gcc -c $(CFLAGS) playlist.c

clean:
	rm -f imp *.o
