Import('*')

objects = []

# INCLUDE DIRECTORIES
# Implements: COR010
includes = [
	'api',
	'MCAL_Gen\inc',
	'MCAL_Modules\Can\inc',
	'MCAL_Modules\Dio\inc',
	'MCAL_Modules\Fls\inc',
	'MCAL_Modules\Gpt\inc',
	'MCAL_Modules\Irq\inc',
	'MCAL_Modules\Mcu\inc',
	'MCAL_Modules\Port\inc',
	'MCAL_Modules\Wdg\inc',
	#'Overlay_Mem',
	'TC26x',
	'Integration',
]


# SOURCE FILES
sources = [
	'MCAL_Modules\Can\src\Can_17_MCanP.c',
	'MCAL_Modules\Can\src\Can_17_MCanP_Platform.c',
	'MCAL_Modules\Dio\src\Dio.c',
	'MCAL_Modules\Dio\src\dio_Ver.c',
	'MCAL_Modules\Fls\src\Fls_17_Pmu.c',
	'MCAL_Modules\Fls\src\Fls_17_Pmu_ac.c',
	'MCAL_Modules\Fls\src\Fls_17_Pmu_Ver.c',
	'MCAL_Modules\Gpt\src\Gpt.c',
	'MCAL_Modules\Gpt\src\Gpt_Ver.c',
	'MCAL_Modules\Irq\src\AscLin_Irq.c',
	'MCAL_Modules\Irq\src\Can_Irq.c',
	'MCAL_Modules\Irq\src\Dma_Irq.c',
	'MCAL_Modules\Irq\src\Fls_Irq.c',
	'MCAL_Modules\Irq\src\Gtm_Irq.c',
	'MCAL_Modules\Irq\src\Irq.c',
	'MCAL_Modules\Irq\src\Mcal_Trap.c',
	'MCAL_Modules\Mcu\src\Gtm.c',
	'MCAL_Modules\Mcu\src\Gtm_Platform.c',
	'MCAL_Modules\Mcu\src\Mcu.c',
	'MCAL_Modules\Mcu\src\Mcu_Crc.c',
	'MCAL_Modules\Mcu\src\Mcu_Dma.c',
	'MCAL_Modules\Mcu\src\Mcu_Platform.c',
	'MCAL_Modules\Mcu\src\Mcu_Ver.c',
	'MCAL_Modules\Port\src\Port.c',
	'MCAL_Modules\Wdg\src\Wdg_17_Scu.c',
	'MCAL_Modules\Wdg\src\Wdg_17_Scu_Safe.c',
	#'Overlay_Mem/Overlay_Mem.c',
	'Integration/StartUp.c',
	'Integration/Mcal.c',
	'Integration/Mcal_TcLib.c',
	'Integration/Mcal_WdgLib.c',
	'Integration/McuFunc.c',
	'Integration/SchM.c',
	'Integration/Stubs.c',
]

# GENERATED SOURCE FILES
gen_sources = [
	'MCAL_Gen\src\Can_17_MCanP_PBCfg.c',
	'MCAL_Gen\src\Dio_PBCfg.c',
	'MCAL_Gen\src\Fls_17_Pmu_PBCfg.c',
	'MCAL_Gen\src\Gpt_PBCfg.c',
	'MCAL_Gen\src\Gtm_LCfg.c',
	'MCAL_Gen\src\Gtm_PBCfg.c',
	'MCAL_Gen\src\Mcu_PBCfg.c',
	'MCAL_Gen\src\Port_PBCfg.c',
	'MCAL_Gen\src\Wdg_17_Scu_PBCfg.c',
]

# ADD INCLUDE DIRECTORIES
for include in includes:
	env.Append(CPPPATH=[Dir(include).abspath])

# COMPILE SOURCE FILES
for source in sources:
	objects += env.Object(source)
	
# GENERATED SOURCE FILES
for gen_source in gen_sources:
	objects += env.Object(gen_source)
	
#objects = env.Library('MCAL', objects)

# RETURN					  
Return('objects')