Commits

Steven Knight  committed d4f1762

Make the (s) and variables upper-case.

  • Participants
  • Parent commits 1812254

Comments (0)

Files changed (20)

File src/engine/SCons/Builder.py

 	    t = kw['target']
 	    if type(t) is type(""):
 	        t = [t]
-	    loc['targets'] = PathList(map(os.path.normpath, t))
-	    loc['target'] = loc['targets'][0]
+	    loc['TARGETS'] = PathList(map(os.path.normpath, t))
+	    loc['TARGET'] = loc['TARGETS'][0]
 	if kw.has_key('source'):
 	    s = kw['source']
 	    if type(s) is type(""):
 	        s = [s]
-            loc['sources'] = PathList(map(os.path.normpath, s))
+            loc['SOURCES'] = PathList(map(os.path.normpath, s))
 
 	glob = {}
 	if kw.has_key('env'):

File src/engine/SCons/BuilderTests.py

 	c = test.read(outfile, 'r')
 	assert c == "act.py: xyzzy\n", c
 
-	cmd2 = r'%s %s %s $target' % (python, act_py, outfile)
+	cmd2 = r'%s %s %s $TARGET' % (python, act_py, outfile)
 
 	builder = SCons.Builder.Builder(action = cmd2)
 	r = builder.execute(target = 'foo')
 	c = test.read(outfile, 'r')
 	assert c == "act.py: foo\n", c
 
-	cmd3 = r'%s %s %s ${targets}' % (python, act_py, outfile)
+	cmd3 = r'%s %s %s ${TARGETS}' % (python, act_py, outfile)
 
 	builder = SCons.Builder.Builder(action = cmd3)
 	r = builder.execute(target = ['aaa', 'bbb'])
 	c = test.read(outfile, 'r')
 	assert c == "act.py: aaa bbb\n", c
 
-	cmd4 = r'%s %s %s $sources' % (python, act_py, outfile)
+	cmd4 = r'%s %s %s $SOURCES' % (python, act_py, outfile)
 
 	builder = SCons.Builder.Builder(action = cmd4)
 	r = builder.execute(source = ['one', 'two'])
 	c = test.read(outfile, 'r')
 	assert c == "act.py: one two\n", c
 
-	cmd4 = r'%s %s %s ${sources[:2]}' % (python, act_py, outfile)
+	cmd4 = r'%s %s %s ${SOURCES[:2]}' % (python, act_py, outfile)
 
 	builder = SCons.Builder.Builder(action = cmd4)
 	r = builder.execute(source = ['three', 'four', 'five'])
 	c = test.read(outfile, 'r')
 	assert c == "act.py: three four\n", c
 
-	cmd5 = r'%s %s %s $target XYZZY' % (python, act_py, outfile)
+	cmd5 = r'%s %s %s $TARGET XYZZY' % (python, act_py, outfile)
 
 	builder = SCons.Builder.Builder(action = cmd5)
 	r = builder.execute(target = 'out5', env = {'ENV' : {'XYZZY' : 'xyzzy'}})

File src/engine/SCons/Defaults.py

     ConstructionEnvironment = {
         'CC'         : 'cc',
         'CCFLAGS'    : '',
-        'CCCOM'      : '$CC $CCFLAGS -c -o $target $sources',
+        'CCCOM'      : '$CC $CCFLAGS -c -o $TARGET $SOURCES',
         'CXX'        : 'c++',
         'CXXFLAGS'   : '$CCFLAGS',
-        'CXXCOM'     : '$CXX $CXXFLAGS -c -o $target $sources',
+        'CXXCOM'     : '$CXX $CXXFLAGS -c -o $TARGET $SOURCES',
         'LINK'       : '$CXX',
         'LINKFLAGS'  : '',
-        'LINKCOM'    : '$LINK $LINKFLAGS -o $target $sources',
+        'LINKCOM'    : '$LINK $LINKFLAGS -o $TARGET $SOURCES',
         'AR'         : 'ar',
         'ARFLAGS'    : 'r',
-        'ARCOM'      : '$AR $ARFLAGS $target $sources\nranlib $target',
+        'ARCOM'      : '$AR $ARFLAGS $TARGET $SOURCES\nranlib $TARGET',
         'BUILDERS'   : [Object, Program, Library],
         'OBJPREFIX'  : '',
         'OBJSUFFIX'  : '.o',
     ConstructionEnvironment = {
         'CC'         : 'cl',
         'CCFLAGS'    : '/nologo',
-        'CCCOM'      : '$CC $CCFLAGS /c $sources /Fo$target',
+        'CCCOM'      : '$CC $CCFLAGS /c $SOURCES /Fo$TARGET',
         'CXX'        : '$CC',
         'CXXFLAGS'   : '$CCFLAGS',
-        'CXXCOM'     : '$CXX $CXXFLAGS /c $sources /Fo$target',
+        'CXXCOM'     : '$CXX $CXXFLAGS /c $SOURCES /Fo$TARGET',
         'LINK'       : 'link',
         'LINKFLAGS'  : '',
-        'LINKCOM'    : '$LINK $LINKFLAGS /out:$target $sources',
+        'LINKCOM'    : '$LINK $LINKFLAGS /out:$TARGET $SOURCES',
         'AR'         : 'lib',
         'ARFLAGS'    : '/nologo',
-        'ARCOM'      : '$AR $ARFLAGS /out:$target $sources',
+        'ARCOM'      : '$AR $ARFLAGS /out:$TARGET $SOURCES',
         'BUILDERS'   : [Object, Program, Library],
         'OBJPREFIX'  : '',
         'OBJSUFFIX'  : '.obj',

File src/engine/SCons/UtilTests.py

     def test_subst(self):
 	"""Test the subst function."""
 	loc = {}
-        loc['targets'] = PathList(map(os.path.normpath, [ "./foo/bar.exe",
+        loc['TARGETS'] = PathList(map(os.path.normpath, [ "./foo/bar.exe",
                                                           "/bar/baz.obj",
                                                           "../foo/baz.obj" ]))
-	loc['target'] = loc['targets'][0]
-        loc['sources'] = PathList(map(os.path.normpath, [ "./foo/blah.cpp",
+        loc['TARGET'] = loc['TARGETS'][0]
+        loc['SOURCES'] = PathList(map(os.path.normpath, [ "./foo/blah.cpp",
                                                           "/bar/ack.cpp",
                                                           "../foo/ack.c" ]))
         loc['xxx'] = None
                 return string.replace(str, '/', os.sep)
 
 
-        newcom = scons_subst("test $targets $sources", loc, {})
+        newcom = scons_subst("test $TARGETS $SOURCES", loc, {})
         assert newcom == cvt("test foo/bar.exe /bar/baz.obj ../foo/baz.obj foo/blah.cpp /bar/ack.cpp ../foo/ack.c")
 
-        newcom = scons_subst("test ${targets[:]} ${sources[0]}", loc, {})
+        newcom = scons_subst("test ${TARGETS[:]} ${SOURCES[0]}", loc, {})
         assert newcom == cvt("test foo/bar.exe /bar/baz.obj ../foo/baz.obj foo/blah.cpp")
 
-        newcom = scons_subst("test ${targets[1:]}v", loc, {})
+        newcom = scons_subst("test ${TARGETS[1:]}v", loc, {})
         assert newcom == cvt("test /bar/baz.obj ../foo/baz.objv")
 
-        newcom = scons_subst("test $target", loc, {})
+        newcom = scons_subst("test $TARGET", loc, {})
         assert newcom == cvt("test foo/bar.exe")
 
-        newcom = scons_subst("test $target$source[0]", loc, {})
+        newcom = scons_subst("test $TARGET$SOURCE[0]", loc, {})
         assert newcom == cvt("test foo/bar.exe[0]")
 
-        newcom = scons_subst("test ${target.file}", loc, {})
+        newcom = scons_subst("test ${TARGET.file}", loc, {})
         assert newcom == cvt("test bar.exe")
 
-        newcom = scons_subst("test ${target.filebase}", loc, {})
+        newcom = scons_subst("test ${TARGET.filebase}", loc, {})
         assert newcom == cvt("test bar")
 
-        newcom = scons_subst("test ${target.suffix}", loc, {})
+        newcom = scons_subst("test ${TARGET.suffix}", loc, {})
         assert newcom == cvt("test .exe")
 
-        newcom = scons_subst("test ${target.base}", loc, {})
+        newcom = scons_subst("test ${TARGET.base}", loc, {})
         assert newcom == cvt("test foo/bar")
 
-        newcom = scons_subst("test ${target.dir}", loc, {})
+        newcom = scons_subst("test ${TARGET.dir}", loc, {})
         assert newcom == cvt("test foo")
 
         newcom = scons_subst("test $xxx", loc, {})

File test/Command.py

 test.write('SConstruct', """
 env = Environment()
 env.Command(target = 'f1.out', source = 'f1.in',
-            action = r'%s build.py $target $sources')
+            action = r'%s build.py $TARGET $SOURCES')
 env.Command(target = 'f2.out', source = 'f2.in',
-            action = r'%s' + " build.py temp2 $sources\\n" + r'%s' + " build.py $target temp2")
+            action = r'%s' + " build.py temp2 $SOURCES\\n" + r'%s' + " build.py $TARGET temp2")
 env.Command(target = 'f3.out', source = 'f3.in',
-            action = [r'%s build.py temp3 $sources',
-                      r'%s build.py $target temp3'])
+            action = [r'%s build.py temp3 $SOURCES',
+                      r'%s build.py $TARGET temp3'])
 # Eventually, add ability to do execute Python code.
 """ % (python, python, python, python, python))
 

File test/Default.py

 """)
 
 test.write(['one', 'SConstruct'], """
-B = Builder(name = 'B', action = r'%s ../build.py $target $sources')
+B = Builder(name = 'B', action = r'%s ../build.py $TARGET $SOURCES')
 env = Environment(BUILDERS = [B])
 env.B(target = 'foo.out', source = 'foo.in')
 env.B(target = 'bar.out', source = 'bar.in')
 """ % python)
 
 test.write(['two', 'SConstruct'], """
-B = Builder(name = 'B', action = r'%s ../build.py $target $sources')
+B = Builder(name = 'B', action = r'%s ../build.py $TARGET $SOURCES')
 env = Environment(BUILDERS = [B])
 env.B(target = 'foo.out', source = 'foo.in')
 env.B(target = 'bar.out', source = 'bar.in')
 """ % python)
 
 test.write(['three', 'SConstruct'], """
-B = Builder(name = 'B', action = r'%s ../build.py $target $sources')
+B = Builder(name = 'B', action = r'%s ../build.py $TARGET $SOURCES')
 env = Environment(BUILDERS = [B])
 env.B(target = 'foo.out', source = 'foo.in')
 env.B(target = 'bar.out', source = 'bar.in')

File test/Depends.py

 
 test.write('SConstruct', """
 Foo = Builder(name = "Foo",
-              action = "%s build.py $target $sources subdir/foo.dep")
+              action = "%s build.py $TARGET $SOURCES subdir/foo.dep")
 Bar = Builder(name = "Bar",
-              action = "%s build.py $target $sources subdir/bar.dep")
+              action = "%s build.py $TARGET $SOURCES subdir/bar.dep")
 env = Environment(BUILDERS = [Foo, Bar])
 env.Depends(target = ['f1.out', 'f2.out'], dependency = 'subdir/foo.dep')
 env.Depends(target = 'f3.out', dependency = 'subdir/bar.dep')
 import os
 bin1_path = r'%s' + os.pathsep + os.environ['PATH']
 bin2_path = r'%s' + os.pathsep + os.environ['PATH']
-Bld = Builder(name = 'Bld', action = "build.py $target $sources")
+Bld = Builder(name = 'Bld', action = "build.py $TARGET $SOURCES")
 bin1 = Environment(ENV = {'PATH' : bin1_path}, BUILDERS = [Bld])
 bin2 = Environment(ENV = {'PATH' : bin2_path}, BUILDERS = [Bld])
 bin1.Bld(target = 'bin1.out', source = 'input')

File test/Library.py

 #XXX Need to switch TestBld to Program() when LIBS variable is working.
 test.write('SConstruct', """
 TestBld = Builder(name='TestBld',
-                  action='cc -o $target $sources -L./ -lfoo1 -lfoo2 -lfoo3')
+                  action='cc -o $TARGET $SOURCES -L./ -lfoo1 -lfoo2 -lfoo3')
 env = Environment(BUILDERS=[ TestBld, Library ])
 env.Library(target = 'foo1', source = 'f1.c')
 env.Library(target = 'foo2', source = 'f2a.c f2b.c f2c.c')

File test/builderrors.py

 """)
 
 test.write(['one', 'SConstruct'], """
-B0 = Builder(name = 'B0', action = r'%s ../build.py 0 $target $sources')
-B1 = Builder(name = 'B1', action = r'%s ../build.py 1 $target $sources')
+B0 = Builder(name = 'B0', action = r'%s ../build.py 0 $TARGET $SOURCES')
+B1 = Builder(name = 'B1', action = r'%s ../build.py 1 $TARGET $SOURCES')
 env = Environment(BUILDERS = [B0, B1])
 env.B1(target = 'f1.out', source = 'f1.in')
 env.B0(target = 'f2.out', source = 'f2.in')
 test.fail_test(os.path.exists(test.workpath('f3.out')))
 
 test.write(['two', 'SConstruct'], """
-B0 = Builder(name = 'B0', action = r'%s ../build.py 0 $target $sources')
-B1 = Builder(name = 'B1', action = r'%s ../build.py 1 $target $sources')
+B0 = Builder(name = 'B0', action = r'%s ../build.py 0 $TARGET $SOURCES')
+B1 = Builder(name = 'B1', action = r'%s ../build.py 1 $TARGET $SOURCES')
 env = Environment(BUILDERS = [B0, B1])
 env.B0(target = 'f1.out', source = 'f1.in')
 env.B1(target = 'f2.out', source = 'f2.in')
 test.fail_test(os.path.exists(test.workpath('f3.out')))
 
 test.write(['three', 'SConstruct'], """
-B0 = Builder(name = 'B0', action = r'%s ../build.py 0 $target $sources')
-B1 = Builder(name = 'B1', action = r'%s ../build.py 1 $target $sources')
+B0 = Builder(name = 'B0', action = r'%s ../build.py 0 $TARGET $SOURCES')
+B1 = Builder(name = 'B1', action = r'%s ../build.py 1 $TARGET $SOURCES')
 env = Environment(BUILDERS = [B0, B1])
 env.B0(target = 'f1.out', source = 'f1.in')
 env.B0(target = 'f2.out', source = 'f2.in')

File test/multiline.py

 """)
 
 test.write('SConstruct', """
-B1 = Builder(name = 'B1', action = [r'%s build.py .temp $sources',
-                                    r'%s build.py $targets .temp'])
-B2 = Builder(name = 'B2', action = r'%s' + " build.py .temp $sources\\n" + r'%s' + " build.py $targets .temp")
+B1 = Builder(name = 'B1', action = [r'%s build.py .temp $SOURCES',
+                                    r'%s build.py $TARGETS .temp'])
+B2 = Builder(name = 'B2', action = r'%s' + " build.py .temp $SOURCES\\n" + r'%s' + " build.py $TARGETS .temp")
 env = Environment(BUILDERS = [B1, B2])
 env.B1(target = 'foo1.out', source = 'foo1.in')
 env.B2(target = 'foo2.out', source = 'foo2.in')

File test/option--.py

 
 test.write('SConstruct', """
 MyBuild = Builder(name = "MyBuild",
-                  action = r'%s build.py $targets')
+                  action = r'%s build.py $TARGETS')
 env = Environment(BUILDERS = [MyBuild])
 env.MyBuild(target = '-f1.out', source = 'f1.in')
 env.MyBuild(target = '-f2.out', source = 'f2.in')

File test/option-c.py

 """)
 
 test.write('SConstruct', """
-B = Builder(name = 'B', action = r'%s build.py $targets $sources')
+B = Builder(name = 'B', action = r'%s build.py $TARGETS $SOURCES')
 env = Environment(BUILDERS = [B])
 env.B(target = 'foo1.out', source = 'foo1.in')
 env.B(target = 'foo2.out', source = 'foo2.in')

File test/option-i.py

 """)
 
 test.write('SConstruct', """
-Succeed = Builder(name = "Succeed", action = r'%s succeed.py $targets')
-Fail = Builder(name = "Fail", action = r'%s fail.py $targets')
+Succeed = Builder(name = "Succeed", action = r'%s succeed.py $TARGETS')
+Fail = Builder(name = "Fail", action = r'%s fail.py $TARGETS')
 env = Environment(BUILDERS = [Succeed, Fail])
 env.Fail(target = 'aaa.1', source = 'aaa.in')
 env.Succeed(target = 'aaa.out', source = 'aaa.1')

File test/option-j.py

 
 test.write('SConstruct', """
 MyBuild = Builder(name = "MyBuild",
-                  action = r'%s build.py $targets')
+                  action = r'%s build.py $TARGETS')
 env = Environment(BUILDERS = [MyBuild])
 env.MyBuild(target = 'f1', source = 'f1.in')
 env.MyBuild(target = 'f2', source = 'f2.in')

File test/option-k.py

 """)
 
 test.write('SConstruct', """
-Succeed = Builder(name = "Succeed", action = r'%s succeed.py $targets')
-Fail = Builder(name = "Fail", action = r'%s fail.py $targets')
+Succeed = Builder(name = "Succeed", action = r'%s succeed.py $TARGETS')
+Fail = Builder(name = "Fail", action = r'%s fail.py $TARGETS')
 env = Environment(BUILDERS = [Succeed, Fail])
 env.Fail(target = 'aaa.1', source = 'aaa.in')
 env.Succeed(target = 'aaa.out', source = 'aaa.1')

File test/option-n.py

 
 test.write('SConstruct', """
 MyBuild = Builder(name = "MyBuild",
-                  action = r'%s build.py $targets')
+                  action = r'%s build.py $TARGETS')
 env = Environment(BUILDERS = [MyBuild])
 env.MyBuild(target = 'f1.out', source = 'f1.in')
 env.MyBuild(target = 'f2.out', source = 'f2.in')

File test/option-s.py

 
 test.write('SConstruct', """
 MyBuild = Builder(name = "MyBuild",
-                  action = r'%s build.py $target')
+                  action = r'%s build.py $TARGET')
 env = Environment(BUILDERS = [MyBuild])
 env.MyBuild(target = 'f1.out', source = 'f1.in')
 env.MyBuild(target = 'f2.out', source = 'f2.in')

File test/subdir.py

 """)
 
 test.write('SConstruct', """
-B = Builder(name = "B", action = "python build.py $targets $sources")
+B = Builder(name = "B", action = "python build.py $TARGETS $SOURCES")
 env = Environment(BUILDERS = [B])
 env.B(target = 'subdir/f1.out', source = 'subdir/f1.in')
 env.B(target = 'subdir/f2.out', source = 'subdir/f2.in')

File test/up-to-date.py

 """)
 
 test.write('SConstruct', """
-B = Builder(name = "B", action = r'%s build.py $targets $sources')
+B = Builder(name = "B", action = r'%s build.py $TARGETS $SOURCES')
 env = Environment(BUILDERS = [B])
 env.B(target = 'f1.out', source = 'f1.in')
 env.B(target = 'f2.out', source = 'f2.in')