1. SCons
  2. Core
  3. SCons

Commits

Steven Knight  committed f4b52ec

Make Default work with subdirectories.

  • Participants
  • Parent commits d52dd5a
  • Branches default

Comments (0)

Files changed (4)

File src/CHANGES.txt

View file
 
 RELEASE 0.02 - 
 
-  - Fixed the version comment in the scons.bat (the UNIX geek used
-    # instead of @rem).
-
-  - Fix to setup.py so it doesn't require a sys.argv[1] argument.
-
-  - Provide make-like warning message for "command not found" and
-    similar errors.
-
   From Charles Crain:
 
-  - Added support for the Install method.
-
-  - Added support for the BuildDir method.
-
-  - Added the Export method.
+  - Added the Install(), BuildDir(), and Export() methods.
 
   - Fix the -C option by delaying setting the top of the FS tree.
 
 
   - Fixed variable substitution in CPPPATH and LIBPATH.
 
+  From Steven Knight:
+
+  - Fixed the version comment in the scons.bat (the UNIX geek used
+    # instead of @rem).
+
+  - Fix to setup.py so it doesn't require a sys.argv[1] argument.
+
+  - Provide make-like warning message for "command not found" and
+    similar errors.
+
+  - Added an EXAMPLES section to the man page.
+
+  - Make Default() targets properly relative to their SConscript
+    file's subdirectory.
+
   From Anthony Roach:
 
   - Documented CXXFLAGS, CXXCOM, and CPPPATH.
 
   - Made Default() accept Nodes as arguments.
 
-  - Changed Export() to make it easier to use
+  - Changed Export() to make it easier to use.
   
-  - Added Import() method.
-  
-  - Added Return() method.
+  - Added the Import() and Return() methods.
 
 
 

File src/engine/SCons/Script/.aeignore

View file
+*,D
+*.pyc
+.*.swp
+.consign

File src/engine/SCons/Script/SConscript.py

View file
             default_targets.append(t)
         else:
             for s in string.split(t):
-                default_targets.append(s)
+                default_targets.append(SCons.Node.FS.default_fs.File(s))
 
 def Help(text):
     if print_help:

File test/Default.py

View file
 test.fail_test(test.read(test.workpath('four', 'bar.out')) != "four/bar.in\n")
 
 
+
+test.subdir('subdir')
+
+test.write('SConstruct', """
+B = Builder(name = 'B', action = r'%s build.py $TARGET $SOURCES')
+env = Environment(BUILDERS = [B])
+env.B(target = 'xxx.out', source = 'xxx.in')
+SConscript('subdir/SConscript')
+""" % python)
+
+test.write('xxx.in', "xxx.in\n")
+
+test.write(['subdir', 'SConscript'], """
+B = Builder(name = 'B', action = r'%s build.py $TARGET $SOURCES')
+env = Environment(BUILDERS = [B])
+env.B(target = 'xxx.out', source = 'xxx.in')
+Default('xxx.out')
+""" % python)
+
+test.write(['subdir', 'xxx.in'], "subdir/xxx.in\n")
+
+test.run()	# no arguments, use the Default
+
+test.fail_test(os.path.exists(test.workpath('xxx.out')))
+test.fail_test(test.read(test.workpath('subdir', 'xxx.out')) != "subdir/xxx.in\n")
+
+
+
 test.pass_test()