scons has a list flattening utility! effing awesome.