# If KERNELRELEASE is defined, we've been invoked from the
# kernel build system and can use its language.
ifneq ($(KERNELRELEASE),)
    obj-m := misc.o 

# Otherwise we were called directly from the command
# line; invoke the kernel build system.
else
	KVER ?= $(shell uname -r)
	TOPDIR ?= /lib/modules/$(KVER)
	KERNELDIR ?= $(TOPDIR)/build
	INSTALLDIR ?= $(TOPDIR)/extra/drivers/input
	PWD  := $(shell pwd)

default:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

install:
	install -m 644 misc.ko $(INSTALLDIR)
	depmod -a

clean:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean

endif
