###
###	Makefile
###
###	Christophe Lucas <c.lucas@ifrance.com>
###	Luca Amore <luca@lookee.it>     
###

VERSION="0.7.1"

CC=gcc
CFLAGS=-Wall -O2 -DVERSION=\"$(VERSION)\" `sdl-config --cflags`
DEP=main.o bayer.o device.o ftplib.o ftpup.o config.o dump_thomas.o capture.o
LIBS=-lSDL -ljpeg 
INCLUDES=-I /lib/modules/`uname -r`/build/include

.c.o: $(DEP)
	$(CC) $(CFLAGS) $(INCLUDES) -c $<

webcam: $(DEP)
	$(CC) $(CFLAGS) $(DEP) $(LIBS) -o $@

help: 
	@echo "****************************************"
	@echo "** to get last release:               **"
	@echo "** http://www.lookee.it/index.php?p=5 **"	
	@echo "**                                    **"	
	@echo "** get driver sn9c10x from:           **"
	@echo "** http://www.linux-projects.org      **"
	@echo "** You must have >= 2.6.10 kernel     **"
	@echo "**                                    **"
	@echo "** 'webcam' target to build program   **"
	@echo "**                                    **"
	@echo "** 'dist' : to build tarball          **"
	@echo "****************************************"

dist:
	cd .. && tar -czvf sn-webcam-$(VERSION).tar.gz sn-webcam/
	

clean:;
	rm -f *.o *~ core webcam cam.jpg
