# Makefile for bluetooth driver
# Comment/uncomment the following line to disable/enable debugging
#DEBUG = y
#TTY_OPEN_EXCLUSIVE = y

# Add your debugging flag (or not) to CFLAGS
ifeq ($(DEBUG), y)
  DEBFLAGS = -O -g # -DBVD_DEBUG  "-O" is needed to expand inlines
else
  DEBFLAGS = -O2
endif

#ifeq ($(TTY_OPEN_EXCLUSIVE),y)
#DEBFLAGS += -DBVD_TTY_OPEN_EXCLUSIVE	
#endif

ccflags-y  += $(DEBFLAGS)
ccflags-y  += -I$(src)/include


ifneq ($(KERNELRELEASE),)


obj-m := evo_bvd.o

#ccflags-y := -I$(src)/include

evo_bvd-y :=src/bvd_if_dev.o src/bvd_net_dev.o src/bvd_tty_dev.o

else

KERNEL_DIR := /lib/modules/$(shell uname -r)/build


PWD := $(shell pwd)

default:
	$(MAKE) -C $(KERNEL_DIR) M=$(PWD)
clean:
	$(MAKE) -C $(KERNEL_DIR) M=$(PWD) clean


endif