
KERNELDIR	:= $(INSTALL_ROOT)/linux

obj-m	+= i2c.o
i2c-objs := ../STM32F4xx_HAL_Driver/system_stm32f4xx.o
i2c-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.o
i2c-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.o
i2c-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.o
i2c-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.o
i2c-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.o
i2c-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.o

i2c-objs += i2c_main.o

EXTRA_CFLAGS	+= -I$(PWD)/../
EXTRA_CFLAGS	+= -I$(PWD)/../STM32F4xx_HAL_Driver
EXTRA_CFLAGS	+= -I$(PWD)/../STM32F4xx_HAL_Driver/Inc
EXTRA_CFLAGS	+= -I$(PWD)/../STM32F4xx_HAL_Driver/Inc/Legacy
EXTRA_CFLAGS	+= -I$(PWD)/../../common_include


modules	:
	make -C $(KERNELDIR) M=`pwd` modules CFLAGS="" LDFLAGS=""
	rm -f *.o

clean:
	make -C $(KERNELDIR) M=`pwd` clean
