from building import *
import os

#add include path
if GetOption('target') == 'mdk5' or GetOption('target') == 'iar':

    #add include path
    include_path = [os.getcwd()+'/Inc']

    src = Glob('Src/*.c')

    group = DefineGroup('SPIRIT1', src, depend = [''], CPPPATH = include_path)

    #add doc path
    doc_path = ''
    txt=[]

    if os.path.isfile(os.path.normpath(os.getcwd()+'/../ReadMe.txt')):
        txt.append(os.path.normpath(os.getcwd()+'/../ReadMe.txt'))
        
    doc_group = DefineGroup('doc', txt, depend = [''], CPPPATH = doc_path)
    Return('group','doc_group')

else:
    #add include path
    include_path = [os.getcwd()+'/Inc']

    src = Glob('Src/*.c')

    group = DefineGroup('SPIRIT1', src, depend = [''], CPPPATH = include_path)


    Return('group')
