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

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

install :
	-modprobe -qr iowarrior;
	cp ./iowarrior.ko /lib/modules/$(shell uname -r)/kernel/drivers/usb/misc/;
	depmod -e -A;
	modprobe iowarrior; 

install_debug :
	-modprobe -qr iowarrior;
	cp ./iowarrior.ko /lib/modules/$(shell uname -r)/kernel/drivers/usb/misc/;
	depmod -e -A;
	modprobe iowarrior debug=1;

clean :
	rm -f *.o;\
	rm -f *.ko;\
	rm -f .*.ko.cmd;\
	rm -f .*.o.cmd;\
	rm -f iowarrior.mod.c;

udev :
	./make_iow_devices 

nodes :
	./make_iow_devices --force-static-nodes

