
KERNELDIR	:= $(INSTALL_ROOT)/linux

gpio-objs := ../STM32F4xx_HAL_Driver/system_stm32f4xx.o
gpio-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.o
#gpio-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_cortex.o
gpio-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.o
gpio-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.o
gpio-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.o
gpio-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.o
gpio-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.o
gpio-objs += ../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.o

gpio-objs += gpio_main.o
obj-m	+= gpio.o

#PWD := $(shell pwd)	
#APPDIR := $(INSTALL_ROOT)/projects/SP19017_OpticalFiber/app

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
