# Comment/uncomment the following line to disable/enable debugging
# DEBUG = y
# CIF_60 = y

ifeq ($(DEBUG),y)
  EXTRA_CFLAGS=-DCIF_DEBUG
endif

ifeq ($(CIF_60),y)
  EXTRA_CFLAGS+=-DCIF_60
  obj-m := cif_cs.o
  cif_cs-objs := cif_main_cs.o cif_irq.o cif_dev.o cif_ioctl.o
else
  obj-m := cif.o
  cif-objs := cif_main.o cif_irq.o cif_dev.o cif_ioctl.o
endif

KDIR   := /lib/modules/$(shell uname -r)/build
PWD    := $(shell pwd)

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

clean:
	rm -f *.o *.ko cif.mod.c
	rm -f .cif*.cmd
	rm -rf .tmp_versions
