# Makefile : auto-generated by script xcc_lkm.sh

# To support cross-compiling for kernel modules:
# For architecture (cpu) 'arch', invoke make as:
# make ARCH=<arch> CROSS_COMPILE=<cross-compiler-prefix> 
ifeq ($(ARCH),arm)
    # *UPDATE* 'KDIR' below to point to the ARM Linux kernel source tree on your box
    KDIR ?= ~/rpi_work/kernel_rpi
else ifeq ($(ARCH),powerpc)
    # *UPDATE* 'KDIR' below to point to the PPC64 Linux kernel source tree on your box
    KDIR ?= ~/kernel/linux-4.9.1
else
   KDIR ?= /lib/modules/$(shell uname -r)/build 
endif

obj-m          += ioctl_undoc_kdrv.o
EXTRA_CFLAGS   += -DDEBUG
$(info Building for: ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} EXTRA_CFLAGS=${EXTRA_CFLAGS})

all:
	make -C $(KDIR) M=$(PWD) modules
install:
	make -C $(KDIR) M=$(PWD) modules_install
clean:
	make -C $(KDIR) M=$(PWD) clean
