
KERNELDIR	:= $(INSTALL_ROOT)/linux

obj-m	+= adc.o
adc-objs := ../STM32F4xx_HAL_Driver/system_stm32f4xx.o
adc-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.o
adc-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.o
adc-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.o
adc-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.o
adc-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.o
adc-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.o
adc-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.o
adc-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.o
adc-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.o

adc-objs += adc_main.o

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
EXTRA_CFLAGS += -I$(PWD)/../

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

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


