Import('*')

env = env.Clone()

env.Prepend(LIBS = [mesautil, gallium])

env.Prepend(LIBPATH = [graw.dir])
env.Prepend(LIBS = ['graw'])
    

if env['platform'] in ('freebsd8', 'sunos'):
    env.Append(LIBS = ['m'])

if env['platform'] == 'freebsd8':
    env.Append(LIBS = ['pthread'])

progs = [
    'clear',
    'disasm',
    'fs-fragcoord',
    'fs-frontface',
    'fs-test',
    'fs-write-z',
    'gs-test',
    'occlusion-query',
    'quad-sample',
    'quad-tex',
    'shader-leak',
    'tex-srgb',
    'tex-swizzle',
    'tri',
    'tri-large',
    'tri-gs',
    'tri-instanced',
    'vs-test',
]

for name in progs:
    program = env.Program(
        target = name,
        source = name + '.c',
    )
    #env.Depends(program, graw)
    env.Alias('graw-progs', program)
