Make Default work with subdirectories.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 22 Dec 2001 06:04:55 +0000 (06:04 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 22 Dec 2001 06:04:55 +0000 (06:04 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@173 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Script/.aeignore [new file with mode: 0644]
src/engine/SCons/Script/SConscript.py
test/Default.py

index 4f161e4c335e0c4166f1e30c8884ce44cf7ab850..36d84bfc93c6142570601f6d26c07cfa6cf31f9b 100644 (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.
 
@@ -36,6 +24,21 @@ RELEASE 0.02 -
 
   - 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.
@@ -44,11 +47,9 @@ RELEASE 0.02 -
 
   - Made Default() accept Nodes as arguments.
 
-  - Changed Export() to make it easier to use
-  
-  - Added Import() method.
+  - Changed Export() to make it easier to use.
   
-  - Added Return() method.
+  - Added the Import() and Return() methods.
 
 
 
diff --git a/src/engine/SCons/Script/.aeignore b/src/engine/SCons/Script/.aeignore
new file mode 100644 (file)
index 0000000..43fe851
--- /dev/null
@@ -0,0 +1,4 @@
+*,D
+*.pyc
+.*.swp
+.consign
index 5fc5487fc60652dc210df3136d847feea9b4f25f..924fd29bd6119ae7fc19f4eeab61519f5187e948 100644 (file)
@@ -114,7 +114,7 @@ def Default(*targets):
             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:
index 135d7cb79492a80a77bde3c7c38ea70759942dd1..5685c3d1cc249f77fd0aaf286c6052a5c6c6140e 100644 (file)
@@ -98,4 +98,32 @@ test.fail_test(test.read(test.workpath('four', 'foo.out')) != "four/foo.in\n")
 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()