ifndef QCONFIG
QCONFIG=qconfig.mk
endif
include $(QCONFIG)

include $(MKFILES_ROOT)/qmacros.mk

NAME=spi-$(SECTION)
EXTRA_SILENT_VARIANTS+=$(subst -, ,$(SECTION))

TYPE = $(firstword $(filter a o dll, $(VARIANTS)) o)
CCFLAGS += $(CCFLAGS_$(SECTION)_$(CPU))

CCFLAGS += -fstack-protector-strong -fPIC -D_FORTIFY_SOURCE=2 -Wtrampolines -Wall -Wformat=2 -Werror=format-extra-args
LDFLAGS += -Wl,-z,relro -Wl,-z,now

LIBS += io-spi slog2 secpol

# Include the SOC specific extra.mk if it exists
-include $(SECTION_ROOT)/extra.mk

include $(SECTION_ROOT)/pinfo.mk

# Generate a dynamic SPI use file
# libio-spi common use file
IOSPI_USEFILE=$(PROJECT_ROOT)/spi.use
# Generate the dynamic SPI usefile name and path
USEFILE_NAME=$(addsuffix $(VARIANT_TAG),$(NAME)).use
USEFILE=$(PWD)/$(USEFILE_NAME)
# Print libio-spi common use file
$(shell cat $(IOSPI_USEFILE) > $(USEFILE))
# SOC usefile
SOC_USEFILE=$(PROJECT_ROOT)/$(SECTION)/$(SECTION).use
# Print SOC usefile if exists
ifneq ($(wildcard $(SOC_USEFILE)),)
$(shell cat $(SOC_USEFILE) >> $(USEFILE))
endif
# Clean up
EXTRA_CLEAN += $(USEFILE)


#####AUTO-GENERATED by packaging script... do not checkin#####
   INSTALL_ROOT_nto = $(PROJECT_ROOT)/../../../install
   USE_INSTALL_ROOT=1
##############################################################

include $(MKFILES_ROOT)/qtargets.mk

-include $(PROJECT_ROOT)/roots.mk