def mkdir(env, source, target):
t = str(target[0])
os.makedirs(t)
- open(os.path.join(t, 'marker'), 'w').write("MakeDirectory\\n")
+ open(os.path.join(t, 'marker'), 'wb').write("MakeDirectory\\n")
MakeDirectory = Builder(action=mkdir, target_factory=Dir)
def collect(env, source, target):
- out = open(str(target[0]), 'w')
+ out = open(str(target[0]), 'wb')
dir = str(source[0])
for f in os.listdir(dir):
f = os.path.join(dir, f)
""")
test.write('SConstruct', """
-env = Environment(DPATH = ['.'],
- DC = r'%s mydc.py',
- DFLAGS = [],
- DCOM = '$DC $TARGET $SOURCES',
- OBJSUFFIX = '.o')
+# Force the 'dmd' tool to get added to the Environment, even if it's not
+# installed, so we get its definition of variables to deal with turning
+# '.d' suffix files into objects.
+env = Environment()
+Tool('dmd')(env)
+# Now replace those suffixes with our fake-D things.
+env.Replace(DPATH = ['.'],
+ DC = r'%s mydc.py',
+ DFLAGS = [],
+ DCOM = '$DC $TARGET $SOURCES',
+ OBJSUFFIX = '.o')
env.Append(CPPSUFFIXES = ['.x'])
env.Object(target = 'test1', source = 'test1.d')
env.InstallAs('test1_d', 'test1.d')
test.fail_test(test.read('aaa.out') != "aaa.in\n")
test.run(arguments = bad_drive + 'not_mentioned',
- stderr = "scons: *** No drive `%s' for target `%snot_mentioned'. Stop.\n" % (bad_drive, bad_drive),
+ stderr = "scons: *** Do not know how to make target `%snot_mentioned'. Stop.\n" % (bad_drive,),
status = 2)
test.run(arguments = bad_drive + 'no_target_1',