###############################################################################
#
#  Filename: Makefile
#
#  copyright 2000 by STMicroelectronics, Inc.  All rights reserved
#
#  Description:
#
#  History:
#  Date      Developer    Comments
#  ---------------------------------------------------------------------------
#  12/20/00  S. Miller    Initial Coding
#
###############################################################################

ifneq ($(KERNELRELEASE),)

obj-$(CONFIG_CPIA2) +=cpia2.o
cpia2-objs:=cpia2_v4l.o cpia2_usb.o cpia2_core.o

else

KERNEL_DIR := /lib/modules/$(shell uname -r)

default: Makefile
	$(MAKE) -C $(KERNEL_DIR)/build SUBDIRS=$(PWD) modules

clean: Makefile
	$(MAKE) -C $(KERNEL_DIR)/build SUBDIRS=$(PWD) clean

remake: clean default

install: default
	install -d $(KERNEL_DIR)/kernel/drivers/media/video
	install -m 644 -c cpia2.ko $(KERNEL_DIR)/kernel/drivers/media/video
	/sbin/depmod -a

deinstall:
	rm $(KERNEL_DIR)/kernel/drivers/media/video/cpia2.ko
	/sbin/depmod -a

cleanall: deinstall clean

Makefile: Makefile_2.6
	cp $? $@

endif
