From ee6fbe513ec8e3d828baf4cd18663f868e7f020d Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 28 Apr 2005 14:14:59 +0000 Subject: [PATCH] Allow "bjam hello.o" to work. [SVN r28514] --- v2/build-system.jam | 14 +++++++++++--- v2/build/virtual-target.jam | 8 ++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/v2/build-system.jam b/v2/build-system.jam index 9d40b424a..0fe4c0121 100755 --- a/v2/build-system.jam +++ b/v2/build-system.jam @@ -138,6 +138,8 @@ if "--clean" in [ modules.peek : ARGV ] clean = true ; } +local bjam-targets ; + for local id in $(target-ids) { if $(id) = clean @@ -146,10 +148,12 @@ for local id in $(target-ids) } else { - local t = [ $(current-project).find $(id) ] ; + local t = [ $(current-project).find $(id) : no-error ] ; if ! $(t) { - error target $(id) does not exist ; + ECHO "notice: could not find main target " $(id) ; + ECHO "notice: assuming it's a name of file to create " ; + bjam-targets += $(id) ; } else { @@ -194,7 +198,11 @@ for t in $(virtual-targets) NOTFILE all ; DEPENDS all : $(actual-targets) ; -if $(clean) +if $(bjam-targets) +{ + UPDATE $(bjam-targets) ; +} +else if $(clean) { UPDATE clean ; } diff --git a/v2/build/virtual-target.jam b/v2/build/virtual-target.jam index 5c57f4405..f2d37bd2c 100644 --- a/v2/build/virtual-target.jam +++ b/v2/build/virtual-target.jam @@ -518,6 +518,14 @@ class file-target : abstract-file-target common.MkDir $(d) ; } + + # For real file target, we create gristless target that + # depends on the real target. This allows to run + # + # bjam hello.o + # + # without trying to guess the name of the real target. + DEPENDS $(target:G=) : $(target) ; } else {