SConscript 文件
SConscript 是 SCons 构建系统的配置文件。以下分别列出了驱动和应用程序的 SConscript 示例:
-
一个典型的驱动程序的 SConscript 示例如下:
Import('AIC_ROOT') Import('PRJ_KERNEL') from building import * cwd = GetCurrentDir() src = Glob('*.c') CPPPATH = [] if GetDepend('DRIVER_DRV_EN'): CPPPATH.append(cwd + '/include/drv') if GetDepend('DRIVER_HAL_EN'): CPPPATH.append(cwd + '/include/hal') CPPPATH.append(cwd + '/include/uapi') # UART driver if GetDepend('AIC_UART_DRV'): if GetDepend('DRIVER_DRV_EN'): src += Glob('drv/uart/*.c') if GetDepend('DRIVER_HAL_EN'): src += Glob('hal/uart/*.c') LOCAL_CCFLAGS += ' -O0' //DefineGroup(name, src, depend,**parameters) group = DefineGroup('aic_osal', src, depend=[''], CPPPATH=CPPPATH, LOCAL_CCFLAGS=LOCAL_CCFLAGS) Return('group')
-
一个典型的应用程序的 SConscript 示例如下:
Import('AIC_ROOT') Import('PRJ_KERNEL') from building import * cwd = GetCurrentDir() path = [cwd + '/include'] path += [cwd + '/base/include'] path += [cwd + '/ge/include'] path += [cwd + '/ve/include'] path += [cwd + '../../../bsp/artinchip/include/uapi'] path += [cwd + '/mpp_test'] if GetDepend(['AIC_MPP_PLAYER_INTERFACE']): #audio decoder path += [cwd + '/middle_media/audio_decoder/include'] path += [cwd + '/middle_media/audio_decoder/decoder'] #base path += [cwd + '/middle_media/base/include'] path += [cwd + '/middle_media/base/parser/mov'] path += [cwd + '/middle_media/base/parser/rawdata'] path += [cwd + '/middle_media/base/stream/file'] src = [] CPPDEFINES = [] # mpp if GetDepend(['LPKG_MPP']): src += Glob('./base/memory/*.c') src += Glob('./ge/*.c') src += Glob('./fb/*.c') src += Glob('ve/decoder/*.c') src += Glob('ve/common/*.c') src += Glob('ve/decoder/jpeg/*.c') src += Glob('ve/decoder/png/*.c') src += Glob('ve/decoder/h264/*.c') src += Glob('./mpp_test/*.c') if GetDepend(['AIC_MPP_PLAYER_INTERFACE']): #audio decoder src += Glob('middle_media/audio_decoder/decoder/*.c') src += Glob('middle_media/audio_decoder/decoder/mp3/mp3_decoder.c') //DefineGroup(name, src, depend,**parameters) group = DefineGroup('mpp', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) Return('group')