# Comment/uncomment the following line to disable/enable debugging # DEBUG = y MODULE_NAME = hid-acer-one KVER = $(shell uname -r) MODDESTDIR = /lib/modules/$(KVER)/kernel/drivers/hid/ # Add debugging flag (or not) to CFLAGS ifeq ($(DEBUG),y) DEBFLAGS = -O -g -DSHORT_DEBUG # "-O" is needed to expand inlines else DEBFLAGS = -O2 endif ccflags-y += $(DEBFLAGS) ifneq ($(KERNELRELEASE),) # call from kernel build system obj-m := hid-acer-one.o else KERNELDIR ?= /lib/modules/$(KVER)/build PWD := $(shell pwd) default: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules endif clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions install: install -p -m 644 $(MODULE_NAME).ko $(MODDESTDIR) /sbin/depmod -a ${KVER} uninstall: rm -f $(MODDESTDIR)/$(MODULE_NAME).ko /sbin/depmod -a ${KVER}