#  This file contains sample code only. It is not part of the production code deliverables.
#
#  Copyright 2019-2023 NXP
#
#  NXP Confidential. This software is owned or controlled by NXP and may only
#  be used strictly in accordance with the applicable license terms. By
#  expressly accepting such terms or by downloading, installing, activating
#  and/or otherwise using the software, you are agreeing that you have read,
#  and that you agree to comply with and are bound by, such license terms. If
#  you do not agree to be bound by the applicable license terms, then you may
#  not retain, install, activate or otherwise use the software.

include project_parameters.mk

################################################################################
# Options
################################################################################
DEBUG ?= FALSE
HW ?= S32G3
SWITCH_TASK_GPT_CHANNEL_CFG ?= 0
TM_STUB_GPT_CHANNEL_CFG ?= 1
CONFIG_MINIHIF ?= FALSE
CONFIG_MINIHIF_HW ?= HIF3
LOOPBACK_TEST ?= FALSE
USE_SJA1105P_DRIVER ?= FALSE
USE_SERDES_DRIVER ?= TRUE
USE_RTD_SERDES_DRIVER ?= FALSE
VERBOSITY_LEVEL ?= 8
FCI_L2BR_TEST ?= FALSE
FCI_RTABLE_TEST ?= FALSE
TEXT_STATS ?= FALSE
# The CONFIGURE_SOC should be equal to FALSE when SLAVE_DRIVER=TRUE
SLAVE_DRIVER ?= FALSE
ifeq ($(SLAVE_DRIVER), TRUE)
    CONFIGURE_SOC ?= FALSE
else
    CONFIGURE_SOC ?= FALSE
endif

# If the USER_MODE=TRUE, user needs to turn on each module's user_mode_support=true and re-generate the sources
USER_MODE ?= FALSE

COMPILER ?= GCC

# The path to the PFE configuration dir and output dir
ifeq ($(SLAVE_DRIVER),FALSE)
    LINKER_DIR := linker/linker_master_app
    ODIR := output
    GDIR := generate
    PROJ_CONFIG_NAME := MasterProject
    APP_NAME := main
else
    LINKER_DIR := linker/linker_slave_app
    ODIR := output_slave
    GDIR := generate_slave
    PROJ_CONFIG_NAME := SlaveProject
    APP_NAME := slave_app
endif

ifeq ($(HW),S32G3)
    ODIR := $(ODIR)_G3
    GDIR := $(GDIR)_G3
    PROJ_CONFIG_NAME := $(PROJ_CONFIG_NAME)_G3
    APP_NAME := $(APP_NAME)_G3
endif

ifeq ($(HW),S32G3_REV1_1)
    ODIR := $(ODIR)_G3_REV1_1
    GDIR := $(GDIR)_G3_REV1_1
    PROJ_CONFIG_NAME := $(PROJ_CONFIG_NAME)_G3_REV1_1
    APP_NAME := $(APP_NAME)_G3_REV1_1
endif
################################################################################
# Compiler specific
################################################################################
ifeq ($(COMPILER),GHS)
    COMPILER_LC := ghs
    CC := $(GHS_DIR)/ccthumb.exe
    LD := $(GHS_DIR)/ccthumb.exe
    AS := $(GHS_DIR)/ccthumb.exe

    LINKER_DEF = $(LINKER_DIR)/autosar_intram.ld
    CLIB := $(GHS_DIR)/lib/thumb2

    CCOPT := \
        -DGHS \
        -c \
        -cpu=cortexm7 \
        -thumb \
        -fpu=vfpv5_d16 \
        -fsingle \
        -C99 \
        --ghstd=last \
        --gnu_asm \
        -dual_debug \
        -G \
        -keeptempfiles \
        -Wimplicit-int \
        -Wshadow \
        -Wtrigraphs \
        -Wundef \
        --unsigned_chars \
        --unsigned_fields \
        --no_commons \
        --no_exceptions \
        --no_slash_comment \
        --prototype_errors \
        --incorrect_pragma_warnings

    CFLAGS_WERROR=--quit_after_warnings

    ifeq ($(DEBUG),FALSE)
        CCOPT += -Osize
    else
        CCOPT += -O0
    endif

    LDOPT := \
        -e Reset_Handler \
        -T $(LINKER_DEF) \
        -map \
        -keepmap \
        -Mn \
        -delete \
        -ignore_debug_references \
        -L$(CLIB) \
        -larch \
        -lstartup \
        -lind_sd \
        -lnk=-v \
        -nostartfiles

    ASOPT := \
        -cpu=cortexm7 \
        -c \
        -preprocess_assembly_files \
        -list

else
ifeq ($(COMPILER),GCC)
    COMPILER_LC := gcc
    CC := $(GCC_DIR)/bin/arm-none-eabi-gcc.exe
    LD := $(GCC_DIR)/bin/arm-none-eabi-gcc.exe
    AS := $(GCC_DIR)/bin/arm-none-eabi-gcc.exe

    LINKER_DEF = $(LINKER_DIR)/autosar_intram.gld
    CLIB  := $(GCC_DIR)/arm-none-eabi/newlib

    CCOPT := \
        -DGCC \
        -c \
        -mcpu=cortex-m7 \
        -mthumb \
        -std=c99 \
        -mfpu=fpv5-sp-d16 \
        -mfloat-abi=hard  \
        -ggdb3 \
        -mlittle-endian \
        -Wall \
        -Wextra \
        -Wstrict-prototypes \
        -Wundef \
        -Wunused \
        -Werror=implicit-function-declaration \
        -Wsign-compare \
        -Wdouble-promotion \
        -funsigned-char \
        -funsigned-bitfields \
        -fomit-frame-pointer \
        -fno-common \
        -pedantic \
        --sysroot="$(CLIB)" \
        -DNO_STDINT_H

    CFLAGS_WERROR=-Werror

    ifeq ($(DEBUG),FALSE)
        CCOPT += -Os
        CCOPT += -fstack-usage
        CCOPT += -fdump-ipa-all
    else
        CCOPT += -O0
    endif

    LDOPT := \
        --entry=Reset_Handler \
        -T$(LINKER_DEF) \
        --sysroot="$(CLIB)" \
        -specs=nano.specs \
        -specs=nosys.specs \
        -nostartfiles \
        -mcpu=cortex-m7 \
        -mthumb \
        -mfpu=fpv5-sp-d16 \
        -mfloat-abi=hard  \
        -ggdb3 \
        -Wl,-Map,$(ODIR)/$(APP_NAME).map \
        -lc \
        -lm \
        -lgcc \
        -mlittle-endian

    ASOPT := \
        -c \
        -mthumb \
        -mcpu=cortex-m7 \
        -x assembler-with-cpp

else
ifeq ($(COMPILER),DIAB)
    COMPILER_LC := diab
    CC := $(DIAB_DIR)/WIN64/bin/dcc.exe
    LD := $(DIAB_DIR)/WIN64/bin/dld.exe
    AS := $(CC)

    LINKER_DEF := $(LINKER_DIR)/autosar_intram.dld
    LIB_PATH := $(DIAB_DIR)/ARMV7EMMG

    CCOPT := \
        -tARMCORTEXM7MG:simple \
        -DDIAB \
        -c \
        -mthumb \
        -std=c99 \
        -g \
        -fstandalone-debug \
        -Wstrict-prototypes \
        -Wsign-compare \
        -Wdouble-promotion \
        -Wunknown-pragmas \
        -Wundef \
        -Wextra \
        -Wall \
        -pedantic \
        -Werror=implicit-function-declaration \
        -fno-common \
        -fno-signed-char \
        -fno-trigraphs

    CFLAGS_WERROR=-Werror

    ifeq ($(DEBUG),FALSE)
        CCOPT += -Oz
        CCOPT += -V
    else
        CCOPT += -O0
    endif

    LDOPT := \
        $(LINKER_DEF) \
        -e Reset_Handler \
        -m30 \
        -Xstack-usage \
        -Xpreprocess-lecl \
        -L$(LIB_PATH) \
        -lc \
        -lm

    ASOPT := \
        -c \
        -mthumb \
        -Xpreprocess-assembly \
        -Xassembly-listing

else
    $(error "This compiler is not supported")
endif
endif
endif

################################################################################
# Path to folders
################################################################################
SRC_DIRS      = src
SRC_DIRS     += startup

INCLUDE_DIRS  = include \
                pfe_firmware

INCLUDE_DIRS += $(PLUGINS_DIR)/Eth_43_PFE_$(AR_PFE_PKG_NAME)/include \
                $(GDIR)/include \
                $(PLUGINS_DIR)/Mcl_$(AR_MCAL_PKG_NAME)/include \
                $(PLUGINS_DIR)/EthTrcv_$(AR_MCAL_PKG_NAME)/include \
                $(PLUGINS_DIR)/Base_$(AR_MCAL_PKG_NAME)/header \
                $(PLUGINS_DIR)/Platform_$(AR_MCAL_PKG_NAME)/startup/include \
                $(foreach mod,$(MCAL_MODULE_LIST),$(PLUGINS_DIR)/$(mod)_$(AR_MCAL_PKG_NAME)/include)

SRC_DIRS     += $(PLUGINS_DIR)/Eth_43_PFE_$(AR_PFE_PKG_NAME)/src \
                $(GDIR)/src \
                $(PLUGINS_DIR)/Platform_$(AR_MCAL_PKG_NAME)/startup/src \
                $(PLUGINS_DIR)/Platform_$(AR_MCAL_PKG_NAME)/startup/src/m7 \
                $(PLUGINS_DIR)/Platform_$(AR_MCAL_PKG_NAME)/startup/src/m7/$(COMPILER_LC) \
                $(foreach mod,$(MCAL_MODULE_LIST),$(PLUGINS_DIR)/$(mod)_$(AR_MCAL_PKG_NAME)/src)

INCLUDE_DIRS    +=  $(FW_DIR)
SRC_DIRS        +=  $(FW_DIR)

ifeq ($(USE_SJA1105P_DRIVER),TRUE)
    INCLUDE_DIRS+=  $(PLUGINS_DIR)/EthSwt_TS_T2D35M20I4R0/include \
                    $(PLUGINS_DIR)/Spi_$(AR_MCAL_PKG_NAME)/include

    SRC_DIRS    +=  $(PLUGINS_DIR)/EthSwt_TS_T2D35M20I4R0/src \
                    $(PLUGINS_DIR)/Spi_$(AR_MCAL_PKG_NAME)/src

    #Exclude standard switch
    INCLUDE_DIRS_EXC := $(PLUGINS_DIR)/EthSwt_$(AR_MCAL_PKG_NAME)/include
    INCLUDE_DIRS_TMP := $(filter-out $(INCLUDE_DIRS_EXC), $(INCLUDE_DIRS))
    INCLUDE_DIRS     := $(INCLUDE_DIRS_TMP)

    SRC_DIRS_EXC := $(PLUGINS_DIR)/EthSwt_$(AR_MCAL_PKG_NAME)/src
    SRC_DIRS_TMP := $(filter-out $(SRC_DIRS_EXC), $(SRC_DIRS))
    SRC_DIRS     := $(SRC_DIRS_TMP)
endif

ifeq ($(USE_RTD_SERDES_DRIVER),TRUE)
    # Currently, RTD Serdes driver has not supported on G3 yet
    ifeq ($(HW), S32G2)
    INCLUDE_DIRS+=  $(PLUGINS_DIR)/Serdes_$(AR_MCAL_PKG_NAME)/include
    SRC_DIRS    +=  $(PLUGINS_DIR)/Serdes_$(AR_MCAL_PKG_NAME)/src
    endif
endif

################################################################################
# Generic compiler options
################################################################################
ifeq ($(HW),S32G3)
    CCOPT += -DS32G3XX
else ifeq ($(HW),S32G3_REV1_1)
    CCOPT += -DS32G3XX
else
    CCOPT += -DS32G2XX
endif

CCOPT += \
        -DS32XX \
        -DUSE_SW_VECTOR_MODE \
        -DD_CACHE_ENABLE \
        -DI_CACHE_ENABLE \
        -DENABLE_FPU \
        -DPFE_CFG_VERBOSITY_LEVEL=$(VERBOSITY_LEVEL) \
        -DMPU_ENABLE
#Use the usermode
ifeq ($(USER_MODE),TRUE)
    CCOPT +=-DMCAL_ENABLE_USER_MODE_SUPPORT
    ASOPT +=-DMCAL_ENABLE_USER_MODE_SUPPORT
endif

ifeq ($(DEBUG),TRUE)
    CCOPT := $(CCOPT) \
             -DNXP_LOG_ENABLED
# check if PFE statistics to text functionality should be enabled
    ifeq ($(TEXT_STATS),TRUE)
        CCOPT := $(CCOPT) \
                 -DPFE_CFG_TEXT_STATS
    endif
endif

# Configure GPT channel to use for TM Stub and switch tasks
TM_STUB_GPT_CHANNEL ?= GptConf_GptChannelConfiguration_GptChannelConfiguration_$(TM_STUB_GPT_CHANNEL_CFG)
SWITCH_TASK_GPT_CHANNEL ?= GptConf_GptChannelConfiguration_GptChannelConfiguration_$(SWITCH_TASK_GPT_CHANNEL_CFG)
CCOPT :=  $(CCOPT) \
          -DTM_STUB_GPT_CHANNEL=$(TM_STUB_GPT_CHANNEL) \
          -DSWITCH_TASK_GPT_CHANNEL=$(SWITCH_TASK_GPT_CHANNEL)

ifeq ($(CONFIG_MINIHIF),TRUE)
    CCOPT :=  $(CCOPT) \
              -DCONFIG_MINIHIF
endif

# Configure HIF channel to use for minihif detached driver
# HIF0 is used by master, do not use it
# HIF3 is used by default
ifeq ($(CONFIG_MINIHIF_HW), HIF0)
    MINIHIF_HW_USE := PFE_PHY_IF_ID_HIF3
else
    MINIHIF_HW_USE := PFE_PHY_IF_ID_$(CONFIG_MINIHIF_HW)
endif
CCOPT :=  $(CCOPT) \
          -DMINIHIF_HW_USE=$(MINIHIF_HW_USE)

ifeq ($(LOOPBACK_TEST),TRUE)
    CCOPT :=  $(CCOPT) \
              -DLOOPBACK_TEST
endif
ifeq ($(USE_SJA1105P_DRIVER),TRUE)
    CCOPT :=  $(CCOPT) \
              -DUSE_SJA1105P_DRIVER
endif
ifeq ($(USE_SERDES_DRIVER),TRUE)
    CCOPT :=  $(CCOPT) \
              -DUSE_SERDES_DRIVER
    ifeq ($(USE_RTD_SERDES_DRIVER),TRUE)
        # Currently, RTD Serdes driver has not supported on G3 yet
        ifeq ($(HW), S32G2)
            CCOPT :=  $(CCOPT) \
                    -DUSE_RTD_SERDES_DRIVER
        endif
    endif
endif
ifeq ($(FCI_L2BR_TEST),TRUE)
    CCOPT :=  $(CCOPT) \
              -DFCI_L2BR_TEST
endif
ifeq ($(FCI_RTABLE_TEST),TRUE)
    CCOPT :=  $(CCOPT) \
              -DFCI_RTABLE_TEST
endif
ifeq ($(SLAVE_DRIVER),TRUE)
    CCOPT :=  $(CCOPT) \
              -DUSE_SLAVE_DRIVER
else
    ifeq ($(CONFIGURE_SOC),TRUE)
        CCOPT :=  $(CCOPT) \
                  -DCONFIGURE_SOC
    endif
endif

# For compiling/linking into ram
CCOPT       := $(CCOPT) -DSINTRAM
CCOPT       := $(CCOPT) -DDISABLE_MCAL_INTERMODULE_ASR_CHECK

# Add define for HM string
CCOPT += -DPFE_CFG_HM_STRINGS_ENABLED
################################################################################
# Compiled files
################################################################################
# $(addsuffix suffix,namesâ€?  : $(addsuffix .c,foo bar) ->  produces the result â€˜foo.c bar.câ€?#                             : $(addprefix src/,foo bar) -> produces the result â€˜src/foo src/barâ€?# Output: -Iinclude -I../include
CCINCLUDES=$(addprefix -I, $(INCLUDE_DIRS))
# Output: List all path .h files (include/Fls_TestSetup.h include/Platform_Types.h ....)
INCLUDE_FILES := $(foreach DIR, $(INCLUDE_DIRS),$(wildcard $(DIR)/*.h))

ifeq ($(USE_SJA1105P_DRIVER), FALSE)
INCLUDE_FILES_EXC += $(GDIR)/include/Spi_Cfg.h \
                     $(GDIR)/include/Spi_Ip_Cfg.h \
                     $(GDIR)/include/Spi_Ip_VS_0_PBcfg.h \
                     $(GDIR)/include/Spi_Ipw_Cfg.h \
                     $(GDIR)/include/Spi_Ipw_VS_0_PBcfg.h \
                     $(GDIR)/include/Spi_VS_0_PBcfg.h

INCLUDE_FILES := $(filter-out $(INCLUDE_FILES_EXC), $(INCLUDE_FILES))
endif

ifeq ($(USE_RTD_SERDES_DRIVER), TRUE)
# Currently, RTD Serdes driver has not supported on G3 yet
ifeq ($(HW), S32G2)
# Use RTD SerDes driver. Filter out custom SerDes related files
INCLUDE_FILES_EXC += include/sample_app_ethswt_g2_serdes.h \
                     include/serdes_xpcs.h

INCLUDE_FILES := $(filter-out $(INCLUDE_FILES_EXC), $(INCLUDE_FILES))
endif
else
# Use custom SerDes driver. Filter out RTD SerDes related files
INCLUDE_FILES_EXC += $(GDIR)/include/Serdes_Cfg.h \
                     $(GDIR)/include/Serdes_Ip_Cfg.h \
                     $(GDIR)/include/Serdes_Ip_PBCfg.h \
                     $(GDIR)/include/Serdes_Ipw_PBCfg.h \

INCLUDE_FILES := $(filter-out $(INCLUDE_FILES_EXC), $(INCLUDE_FILES))
endif

# Currently, RTD Serdes driver has not supported on G3 yet
ifeq ($(HW),S32G3)
    INCLUDE_FILES_EXC += $(GDIR)/include/Serdes_Cfg.h \
                         $(GDIR)/include/Serdes_Ip_Cfg.h \
                         $(GDIR)/include/Serdes_Ip_PBCfg.h \
                         $(GDIR)/include/Serdes_Ipw_PBCfg.h \

    INCLUDE_FILES := $(filter-out $(INCLUDE_FILES_EXC), $(INCLUDE_FILES))
else ifeq ($(HW),S32G3_REV1_1)
    INCLUDE_FILES_EXC += $(GDIR)/include/Serdes_Cfg.h \
                         $(GDIR)/include/Serdes_Ip_Cfg.h \
                         $(GDIR)/include/Serdes_Ip_PBCfg.h \
                         $(GDIR)/include/Serdes_Ipw_PBCfg.h \

    INCLUDE_FILES := $(filter-out $(INCLUDE_FILES_EXC), $(INCLUDE_FILES))
endif

# Output: List all .c and .s files (Fls_TestSetup.c exceptions.c Startup.s Vector_core.s)
SOURCE_FILES := $(foreach DIR,$(SRC_DIRS),$(notdir $(wildcard $(DIR)/*.c))) $(foreach DIR,$(SRC_DIRS),$(notdir $(wildcard $(DIR)/*.s))) $(foreach DIR,$(SRC_DIRS),$(notdir $(wildcard $(DIR)/*.S)))

ifeq ($(USE_SJA1105P_DRIVER), FALSE)
SOURCE_FILES_EXC +=Spi_Ip_VS_0_PBcfg.c \
                   Spi_Ipw_VS_0_PBcfg.c \
                   Spi_VS_0_PBcfg.c

SOURCE_FILES := $(filter-out $(SOURCE_FILES_EXC), $(SOURCE_FILES))
endif

ifeq ($(USE_RTD_SERDES_DRIVER), TRUE)
# Currently, RTD Serdes driver has not supported on G3 yet
ifeq ($(HW), S32G2)
# Use RTD SerDes driver. Filter out custom SerDes related files
SOURCE_FILES_EXC +=sample_app_ethswt_g2_serdes.c \
                   serdes_xpcs.c

SOURCE_FILES := $(filter-out $(SOURCE_FILES_EXC), $(SOURCE_FILES))
endif
else
# Use custom SerDes driver. Filter out RTD SerDes related files
SOURCE_FILES_EXC +=Serdes_Cfg.c \
                   Serdes_Ip_PBCfg.c \
                   Serdes_Ipw_PBCfg.c

SOURCE_FILES := $(filter-out $(SOURCE_FILES_EXC), $(SOURCE_FILES))
endif

# Currently, RTD Serdes driver has not supported on G3 yet
ifeq ($(HW),S32G3)
    SOURCE_FILES_EXC +=Serdes_Cfg.c \
                       Serdes_Ip_PBCfg.c \
                       Serdes_Ipw_PBCfg.c

    SOURCE_FILES := $(filter-out $(SOURCE_FILES_EXC), $(SOURCE_FILES))
else ifeq ($(HW),S32G3_REV1_1)
    SOURCE_FILES_EXC +=Serdes_Cfg.c \
                       Serdes_Ip_PBCfg.c \
                       Serdes_Ipw_PBCfg.c

    SOURCE_FILES := $(filter-out $(SOURCE_FILES_EXC), $(SOURCE_FILES))
endif


################################################################################
# Object files
################################################################################
OUT_FILES := $(SOURCE_FILES:.c=.o)
OUT_FILES := $(OUT_FILES:.s=.o)
OUT_FILES := $(OUT_FILES:.S=.o)

OUT_FILES := $(addprefix $(ODIR)/, $(OUT_FILES))

################################################################################
# Targets
################################################################################
.PHONY: build
build: $(ODIR) $(OUT_FILES) $(ODIR)/$(APP_NAME).elf

vpath %.c $(addsuffix :, $(SRC_DIRS))

$(ODIR)/%.o: %.c $(INCLUDE_FILES)
	@echo CC $<
	@$(CC) $(CCOPT) $(if $(findstring Eth_43_PFE, $<),$(CFLAGS_WERROR),) $(CCINCLUDES) $< -o $@

vpath %.s $(addsuffix :, $(SRC_DIRS))
vpath %.S $(addsuffix :, $(SRC_DIRS))

$(ODIR)/%.o : %.s
	@echo AS $<
	@$(AS) $(ASOPT) $< -o $@

$(ODIR)/%.o : %.S
	@echo AS $<
	@$(AS) $(ASOPT) $< -o $@

# Link all the object files to become one elf file
$(ODIR)/$(APP_NAME).elf: $(OUT_FILES) $(LINKER_DEF)
	@echo LD $@
	$(LD) $(LDOPT) $(OUT_FILES) -o $@

$(ODIR):
	mkdir -p $(ODIR)

.PHONY : clean_all
clean_all: clean_gen clean

.PHONY: clean_gen
clean_gen:
	rm -fr $(GDIR)
	-$(TRESOS_DIR)/bin/tresos_cmd.bat -data $(TRESOS_WORKSPACE_DIR) deleteProject $(PROJ_CONFIG_NAME) 2>&1

.PHONY: clean
clean:
	rm -fr $(ODIR)

.PHONY: generate
generate:
	-$(TRESOS_DIR)/bin/tresos_cmd.bat -data $(TRESOS_WORKSPACE_DIR) importProject $(shell cygpath -m $(abspath $(PROJ_CONFIG_NAME))) 2>&1
	$(TRESOS_DIR)/bin/tresos_cmd.bat -data $(TRESOS_WORKSPACE_DIR) autoconfigure $(PROJ_CONFIG_NAME) GenerateAllVariants 2>&1

.PHONY : help
help :
	@Option () { \
		local vals=""; \
		local argv=("$$@"); \
		for (( i = 2; i < $$#; i += 1 )) do \
			if [ "$$vals" != "" ]; then \
				vals+=" | "; \
			fi; \
			if [ "$$2" = "$${argv[$$i]}" ]; then \
				vals+="\e[32m$${argv[$$i]}\e[0m"; \
			else \
				vals+=$${argv[$$i]}; \
			fi; \
		done; \
		echo -e "$$1 { $$vals }"; \
	}; \
	echo; \
	echo -e "Targets (\e[32mdefault\e[0m):"; \
	echo "  help - just print this and exit"; \
	echo -e "  \e[32mbuild\e[0m - to build application (default target)"; \
	echo "  clean - delete objects files and output file"; \
	echo "  clean_gen - delete generated files"; \
	echo "  clean_all - clean + clean_gen"; \
	echo ;\
	echo -e "Options (\e[32mcurrent value\e[0m):"; \
	echo -e "  TRESOS_DIR - TRESOS installation path (\e[32m$(TRESOS_DIR)\e[0m)"; \
	echo -e "  PLUGINS_DIR - PFE plugin path (\e[32m$(PLUGINS_DIR)\e[0m)"; \
	echo -e "  TRESOS_WORKSPACE_DIR - TRESOS workspace used for build (\e[32m$(TRESOS_WORKSPACE_DIR)\e[0m)"; \
	echo -e "  FW_DIR - Path to PFE firmware to include in build (\e[32m$(FW_DIR)\e[0m)"; \
	echo "           If empty no firmware will be included and proper firmware location must be specified via PfeClassFwMemoryAddress parameter in TRESOS"; \
	echo -e "  GHS_DIR - Path to the GreenHills compiler instalation dir (\e[32m$(GHS_DIR)\e[0m)"; \
	echo -e "  GCC_DIR - Path to the GCC compiler instalation dir (\e[32m$(GCC_DIR)\e[0m)"; \
	echo -e "  DIAB_DIR - Path to the  WinderRiver compiler instalation dir (\e[32m$(DIAB_DIR)\e[0m)"; \
	Option "  COMPILER - To use for build " $(COMPILER) "GCC" "GHS" "DIAB"; \
	Option "  DEBUG - Debug mode " $(DEBUG) "TRUE" "FALSE"; \
	Option "  HW - Target hardware platform " $(HW) "S32G2" "S32G3" "S32G3_REV1_1"; \
	Option "  TEXT_STATS - Build PFE text statistics functionality (in case of DEBUG = TRUE)" $(TEXT_STATS) "TRUE" "FALSE"; \
	Option "  SWITCH_TASK_GPT_CHANNEL_CFG -" $(SWITCH_TASK_GPT_CHANNEL_CFG) "0" "1"; \
	Option "  TM_STUB_GPT_CHANNEL_CFG -" $(TM_STUB_GPT_CHANNEL_CFG) "0" "1"; \
	Option "  CONFIG_MINIHIF -" $(CONFIG_MINIHIF) "TRUE" "FALSE"; \
	Option "  CONFIG_MINIHIF_HW  -" $(CONFIG_MINIHIF_HW) "HIF0" "HIF1" "HIF2" "HIF3"; \
	Option "  LOOPBACK_TEST -" $(LOOPBACK_TEST) "TRUE" "FALSE"; \
	Option "  USE_SJA1105P_DRIVER -" $(USE_SJA1105P_DRIVER) "TRUE" "FALSE"; \
	Option "  USE_SERDES_DRIVER -" $(USE_SERDES_DRIVER) "TRUE" "FALSE"; \
	echo -e "  VERBOSITY_LEVEL - of message output 1 - 10 (\e[32m$(VERBOSITY_LEVEL)\e[0m)"; \
	Option "  FCI_L2BR_TEST -" $(FCI_L2BR_TEST) "TRUE" "FALSE"; \
	Option "  FCI_RTABLE_TEST -" $(FCI_RTABLE_TEST) "TRUE" "FALSE"; \
	Option "  SLAVE_DRIVER -" $(SLAVE_DRIVER) "TRUE" "FALSE"; \
	Option "  CONFIGURE_SOC -" $(CONFIGURE_SOC) "TRUE" "FALSE";
