def __init__(self, builder, env, tlist):
self.builder = builder
- self.scanner = builder.scanner
- self.env = env
self.tlist = tlist
- self.multi = builder.multi
self.name = "ListBuilder(%s)"%builder.name
def execute(self, **kw):
t.build()
return self.status
- def get_raw_contents(self, **kw):
- return apply(self.builder.get_raw_contents, (), kw)
-
- def get_contents(self, **kw):
- return apply(self.builder.get_contents, (), kw)
-
- def src_suffixes(self, env, args):
- return self.builder.src_suffixes(env, args)
-
def targets(self, node):
"""Return the list of targets for this builder instance.
"""
def __cmp__(self, other):
return cmp(self.__dict__, other.__dict__)
+ def __getattr__(self, name):
+ return getattr(self.builder, name)
+
class MultiStepBuilder(BuilderBase):
"""This is a builder subclass that can build targets in
multiple steps. The src_builder parameter to the constructor
if sys.platform == 'win32':
_exe = '.exe'
+ _obj = '.obj'
else:
_exe = ''
+ _obj = '.o'
prog = 'prog' + _exe
subdir_prog = os.path.join('subdir', 'prog' + _exe)
open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read())
nodep = env.Command('nodeps.c', 'nodeps.in', action=copy)
env.Program('nodeps', 'nodeps.c')
+
+env.Object(['one', 'two'], ['one.c'])
""")
test.write(['subdir', 'SConscript'],
#define BAR_STRING "subdir/include/bar.h 1\n"
""")
+test.write('one.c' ,
+r"""
+#include <foo.h>
+void one(void) { }
+""")
test.run(arguments = "--implicit-cache " + args)
# test in the face of a file with no dependencies where the source file is generated:
test.run(arguments = "--implicit-cache nodeps%s"%_exe)
+test.write('nodeps.in',
+r"""
+#include <foo.h>
+
+int
+main(int argc, char *argv[])
+{
+ argv[argc++] = "--";
+ return 0;
+}
+""")
+
+test.run(arguments = "--implicit-cache one%s"%_obj)
+test.run(arguments = "--implicit-cache one%s"%_obj)
test.pass_test()