obj-m := iowarrior.o

default:
	@echo ""
	@echo "Please run commands with sudo"
	@echo "-----------------------------"
	@echo " 'compile' for compile iowarrior.ko"
	@echo " 'install' for install iowarrior.ko"
	@echo " 'clean' for delete compiled data"
	@echo " 'rules' for coping rules"
	@echo " 'info' for get information about installed iowarrior module"
	@echo " 'usb' list of all connected USB device"
	@echo ""

compile:
	make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules
install:
	modprobe -qr iowarrior
	cp iowarrior.ko /lib/modules/$(shell uname -r)/kernel/drivers/usb/misc/
	depmod -e -A
	modprobe iowarrior
	modinfo iowarrior
clean:
	@echo ""
	@echo "Delete all compiled data"
	rm -f *.o
	rm -f *.ko
	rm -f *.ko.cmd
	rm -f *.o.cmd
	rm -f iowarrior.mod.c
	rm -f *.o
	rm -f Module.symvers
	rm -f modules.order
rules:
	cp 10-iowarrior.rules /etc/udev/rules.d
info:
	@echo ""
	@modinfo iowarrior
	@echo ""
usb:
	@echo ""
	@lsusb
	@echo ""
