from building import *
import esconfig

global include_path
global src_path

# 递归扫描目录下的所有文件夹
def traversalallfile(path):
    global include_path
    global src_path
    if os.path.isdir(path):
        temp_path = path.replace('\\','/');
        print(path)
        print(temp_path)
        include_path.append(path)
        src_path += Glob(path + '/*.c')
    filelist = os.listdir(path)
    for file in filelist:
        filepath = os.path.join(path, file)
        if os.path.isdir(filepath):
            traversalallfile(filepath)

cwd = GetCurrentDir()

include_path = []
src_path = []

traversalallfile(GetCurrentDir())

group = DefineGroup('mi_iot', src_path, depend = [''], CPPPATH = include_path)

#返回group_startup
Return('group')
