# Filename: Makefile
#
# This file is the makefile for building SPI example app.
#
#   Copyright (c) 2022 Texas Instruments Incorporated
#
#   All rights reserved. Property of Texas Instruments Incorporated.
#   Restricted rights to use, duplicate or disclose this code are
#   granted through contract.
#
#   The program may not be used without the written permission
#   of Texas Instruments Incorporated or against the terms and conditions
#   stipulated in the agreement under which this program has been
#   supplied.
#******************************************************************************

APP_NAME = mcspi_app

SRCDIR = . ../../Config ../../Utils/$(COMPILER)
INCDIR = .
# List all the external components/interfaces, whose interface header files
# need to be included for this component
INCLUDE_EXTERNAL_INTERFACES = autoSARBSW autosarConfig spi mcu port app_utils

INCLUDE_INTERNAL_INTERFACES = spiAppPriv
spiAppPriv_INCLUDE = $(mcal_PATH)/include $(mcal_PATH)/include/hw/$(SOCFAMILY) $(mcal_PATH)/include/hw

# List all the components required by the application
COMP_LIST_COMMON = spi mcu port app_utils

# Common source files and CFLAGS across all platforms and cores
SRCS_COMMON = McspiApp.c 
#McspiApp_Startup.c
SRCS_COMMON += Port_PBcfg.c
SRCS_COMMON += Spi_PBcfg.c 
SRCS_COMMON += Spi_Cfg.c 
SRCS_COMMON += Mcu_PBcfg.c
SRCS_COMMON += Mcu_Cfg.c
SRCS_COMMON += Dem.c
SRCS_COMMON += Det.c
#SRCS_COMMON += Os.c
SRCS_ASM_COMMON += sys_intvecs.asm sys_startup.asm

#ifeq ($(MCAL_CONFIG),3)
#  SRCS_COMMON += ../Spi_PBcfg.c
#endif

CFLAGS_LOCAL_COMMON = $(MCAL_CFLAGS) -D$(SOCFAMILY)

LNKCMD_FILE = ../../lnk_r5_$(SOCFAMILY)_$(COMPILER).cmd


# Core/SoC/platform specific source files and CFLAGS
# Example:
# SRCS_<core/SoC/platform-name> =
# CFLAGS_LOCAL_<core/SoC/platform-name> =

# Include common make files
ifeq ($(MAKERULEDIR), )
#Makerule path not defined, define this and assume relative path from ROOTDIR
  MAKERULEDIR := $(ROOTDIR)/build/makerules
  export MAKERULEDIR
endif
include $(MAKERULEDIR)/common.mk

# OBJs and libraries are built by using rule defined in rules_<target>.mk
# and need not be explicitly specified here

# Nothing beyond this point
