# SPDX-License-Identifier: GPL-2.0
#
# Makefile for hobot mtd virtual spiflash driver
#

ccflags-y += -I$(srctree)/../hobot-drivers/mailbox/ipc/common/
obj-$(CONFIG_MTD_HOBOT_VSPIFLASH) += hobot_vspi.o

# Support hobot mtd virtual spiflash debug driver
$(shell cp $(srctree)/../hobot-drivers/vspiflash/hobot_vspi.c $(srctree)/../hobot-drivers/vspiflash/hobot_vspi_debug.c 2> /dev/null)
CFLAGS_hobot_vspi_debug.o += -DCONFIG_MTD_HOBOT_VSPIFLASH_DEBUG
obj-$(CONFIG_MTD_HOBOT_VSPIFLASH) += hobot_vspi_debug.o
clean-files += hobot_vspi_debug.c

all: FORCE
	make -C ${OUTPUT_BUILD_DIR}/kernel M=$(PWD) modules

clean: FORCE
	make -C ${OUTPUT_BUILD_DIR}/kernel M=$(PWD) clean

FORCE:
