from building import *
import esconfig

cwd = GetCurrentDir()

#add *.s file
if esconfig.CROSS_TOOL == 'gcc':
    stup = Glob('Startup/gcc/*.s')
elif esconfig.CROSS_TOOL == 'keil':
    stup = Glob('Startup/keil/*.s')
elif esconfig.CROSS_TOOL == 'iar':
    stup = Glob('Startup/iar/*.s')

group_startup = DefineGroup('StartUp', stup, depend = [''])

#add *.c file
src = Glob('System/*.c')

#add include path
include_path = [cwd + '..\..\..\..\Include']
#include_path += [cwd + '..\..\..\..\..\..\Middlewares\EastSoft\usblib\drivers']
include_path += [cwd + '/Include', cwd + '/Include/ES32F0930', cwd + '/System']

group_cmsis = DefineGroup('CMSIS', src, depend = [''], CPPPATH = include_path)

Return('group_startup', 'group_cmsis')
