tags:

views:

300

answers:

1

I would like to build all .c files in a subdirectory. I figured I would do something like this:

src/foo/SConscript contains:

import glob;
here = Dir('.');
sourcefiles_raw = glob.glob(here.path+'/*.c');
print(sourcefiles_raw);
# print them for debugging
# ... then build them (in the process, making scons aware of dependencies)

src/SConscript contains:

SConscript(['foo/SConscript']);

SConstruct contains:

SConscript(['src/SConscript'],build_dir='build');

But it prints [], since glob.glob() runs in the directory build/foo before scons can decide which sourcefiles need to be copied from src/foo to build/foo.

How can I solve this problem?

+1  A: 

never mind, it seems you're supposed to (RTFM) and use scons's Glob() rather than glob.glob().

Jason S