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 {