#
# If have trouble compiling, try changing the KERNEL_VERSION(2, 4, 9)
# around line 158 to KERNEL_VERSION(2, 4, 11), if still doesn't work, try
# the last number as the third number in your kernel version or 1 greater.
#

CC = gcc

# use this line to force build on standard RH7.2 with 2.4.7-10 kernel
#KERNELDIR = /usr/src/linux-2.4.7-10

# use this line to force build on RH7.2 with 2.4.16 kernel
#KERNELDIR = /usr/src/linux-2.4.16

# hopefully this should generally work (assumes symlink to current kernel)
KERNELDIR = /usr/src/linux

CFLAGS += -D__KERNEL__ -DMODULE -I$(KERNELDIR)/include -O -Wall

X = $(KERNELRELEASE)

ifneq ($(KERNELRELEASE),)
obj-m	:= usbvb.o
else
    KDIR	:= /lib/modules/$(shell uname -r)/build
    PWD		:= $(shell pwd)

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

clean:
	/bin/rm -f usbvb.ko
	/bin/rm -f usbvb.o

unload:
	/sbin/rmmod usbvb

load: usbvb.ko
	/sbin/insmod usbvb.ko

fload: usbvb.ko
	/sbin/insmod -f usbvb.ko

devs:
	mknod /dev/usb/vbc0 c 180 200
	mknod /dev/usb/vbc1 c 180 201
	mknod /dev/usb/vbc2 c 180 202
	mknod /dev/usb/vbc3 c 180 203
	mknod /dev/usb/vbv0 c 180 204
	mknod /dev/usb/vbv1 c 180 205
	mknod /dev/usb/vbv2 c 180 206
	mknod /dev/usb/vbv3 c 180 207
