modname := usb_gpio
obj-m := $(modname).o

DEFINES := -DDEBUG
ccflags-y= $(DEFINES) -I/usr/include/

KVERSION := $(shell uname -r)
KMACHINE := $(shell uname -m)

KDIR := /lib/modules/$(KVERSION)/build
PWD := "$$(pwd)"

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

clean:
	$(MAKE) -C $(KDIR) M=$(PWD) clean
	$(MAKE) -f Makefile.helper clean
	rm -rf *~

load:
	-/sbin/rmmod $(modname)
	/sbin/insmod $(modname).ko

helper:
	$(MAKE) -f Makefile.helper
	
