From 0108c26745576a039c78ba0f51957010f27ba14b Mon Sep 17 00:00:00 2001 From: stevenknight Date: Sat, 23 Nov 2002 08:12:11 +0000 Subject: [PATCH] Make building source files fail like Make. git-svn-id: http://scons.tigris.org/svn/scons/trunk@503 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 2 ++ src/engine/SCons/Script/__init__.py | 2 ++ test/SideEffect.py | 1 + test/preserve-source.py | 3 ++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index d74788d5..0c6325fe 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -54,6 +54,8 @@ RELEASE 0.09 - - Add separate $SHOBJPREFIX and $SHOBJSUFFIX construction variables (by default, the same as $OBJPREFIX and $OBJSUFFIX). + - Add a Make-like message when asked to build a source file. + From Steven Knight and Anthony Roach: - Man page: document the fact that Builder calls return Node objects. diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 3f3ff8d8..814d147c 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -105,6 +105,8 @@ class BuildTask(SCons.Taskmaster.Task): def executed(self): SCons.Taskmaster.Task.executed(self) + if not self.targets[0].builder and self.top: + print "scons: Nothing to be done for `%s'." % str(self.targets[0]) # print the tree here instead of in execute() because # this method is serialized, but execute isn't: if print_tree and self.top: diff --git a/test/SideEffect.py b/test/SideEffect.py index 6e374203..6337f681 100644 --- a/test/SideEffect.py +++ b/test/SideEffect.py @@ -70,6 +70,7 @@ test.write('bar.in', 'bar.in 2 \n') test.run(arguments = 'log.txt', stdout=test.wrap_stdout("""\ copy() < bar.in > bar.out copy() < blat.in > blat.out +scons: Nothing to be done for `log.txt'. """)) expect = """\ diff --git a/test/preserve-source.py b/test/preserve-source.py index b0acdaa0..5eddeec2 100644 --- a/test/preserve-source.py +++ b/test/preserve-source.py @@ -53,7 +53,8 @@ test.run(arguments = '.') test.fail_test(test.read('aaa.out') != "aaa.in\n") # -test.run(arguments = "aaa.in", stdout = test.wrap_stdout("")) +test.run(arguments = "aaa.in", + stdout = test.wrap_stdout("scons: Nothing to be done for `aaa.in'.\n")) test.fail_test(not os.path.exists('aaa.in')) -- 2.26.2