
KERNELDIR	:= $(INSTALL_ROOT)/linux

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

fmc-objs += fmc_main.o
obj-m   += fmc.o

PWD := $(shell pwd)	
#UPUPDIR:=$(shell pwd)/$(lastword $(MAKEFILE_LIST))
#UPUPDIR:=$(shell dirname $(UPUPDIR))
#UPUPDIR:=$(shell dirname $(UPUPDIR))
#UPUPDIR:=$(shell dirname $(UPUPDIR))
#APPDIR := $(shell echo "$(UPUPDIR)")

APPDIR := $(INSTALL_ROOT)/projects/gd32450i-eval/app

EXTRA_CFLAGS := -I$(APPDIR)/driver/STM32F4xx_HAL_Driver
EXTRA_CFLAGS += -I$(APPDIR)/driver/STM32F4xx_HAL_Driver/Inc
EXTRA_CFLAGS += -I$(APPDIR)/common_include
EXTRA_CFLAGS += -I$(APPDIR)/driver


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

clean_modules:
	make -C $(KERNELDIR) M=`pwd` clean
	rm -f modules.order
	rm -f *.o







