EXTRA_CFLAGS= -Wall -g


ifneq (${KERNELRELEASE},)

# KERNELRELEASE defined: we are being compiled as part of the Kernel
        obj-m := vga_led.o

else

# We are being compiled as a module: use the Kernel build system

	KERNEL_SOURCE := /usr/src/linux
        PWD := $(shell pwd)

default: module project

project: project.o usbkeyboard.o
	gcc -g -o project usbkeyboard.c usbkeyboard.h project.c -lusb-1.0 -lpthread


project.o: project.c usbkeyboard.h

usbkeyboard.o: usbkeyboard.c usbkeyboard.h

 

module:
	${MAKE} -C ${KERNEL_SOURCE} SUBDIRS=${PWD} modules 

clean:
	${MAKE} -C ${KERNEL_SOURCE} SUBDIRS=${PWD} clean
	${RM} project	

endif 
