#########################################################
#             Makefile for MOS7720   LINUX 2.6          #      
#########################################################

KDIR:=/lib/modules/$(shell uname -r)/build
MDIR:=/lib/modules/$(shell uname -r)/kernel/drivers/usb/serial

EXTRA_CFLAGS += -I$(KDIR)/drivers/usb/serial


obj-m:=mos7720.o

default:
	$(MAKE) -C $(KDIR) $(EXTRA_CFLAGS) SUBDIRS=$(PWD) modules

clean:
	rm -rf .tmp_versions Module.symvers *.mod.c *.o *.ko .*.cmd

load:
	-modprobe usbserial
	insmod mos7720.ko

unload:
	rmmod mos7720

install:
	sh mosinstall	
#install -m 744 mos7720.ko $(MDIR)/mos7720.ko
#	depmod -a
#	cp -f /etc/modprobe.conf /etc/modprobe.conf~
#	grep 'install mos7720' /etc/modprobe.conf || echo "install mos7720 /sbin/modprobe --ignore-install mos7720" >>/etc/modprobe.conf
#	insmod mos7720.ko
uninstall:
	sh mosuninstall	
#$(RM) $(MDIR)/mos7720.ko
#	depmod -a
#	cp -f /etc/modprobe.conf /etc/modprobe.conf~
#	grep -v 'install mos7720' /etc/modprobe.conf~ >/etc/modprobe.conf
#	rmmod mos7720.ko

