#################################### OPTIONS ##################################

# Try changing this to /usr/src/linux/include if you get strange compile errors
INCLUDEDIR = /usr/include

CFLAGS = -D__KERNEL__ -DMODULE -O2 -Wall -Wstrict-prototypes -fomit-frame-pointer -I$(INCLUDEDIR) 

# Uncomment to enable kernel i2c support (for devices with tuners)
# If you know how to cause "make i2c" to set this automatically, let me know.
#CFLAGS += -DOV511_ENABLE_I2C

#################################### TARGETS ##################################

# Make with standard options for cameras and video capture. No TV support.
all: ov511.o ov511_decomp.o

# Make with i2c support (for TV tuners)
# You must uncomment the above "CFLAGS += ..." line for this to work
i2c: all i2c-algo-usb.o

# Just make the MMX decompressor(s)
mmx: ov511_mmx_decomp.o

# Just make the OV518/OV518+ decompression support
ov518: ov518_decomp.o

#################################### RULES ####################################

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

ov511_decomp.o: ov511_decomp.c ov511.h
	gcc -c $(CFLAGS) ov511_decomp.c

ov511_mmx_decomp.o: ov511_mmx_decomp.c ov511.h
	gcc -c $(CFLAGS) ov511_mmx_decomp.c

ov518_decomp.o: ov518_decomp.c ov511.h
	gcc -c $(CFLAGS) ov518_decomp.c

i2c-algo-usb.o: i2c-algo-usb.h
	gcc -c $(CFLAGS) i2c-algo-usb.c

clean:
	rm -f *.o *~ core *.i
