summaryrefslogtreecommitdiff
path: root/jam-files/boost-build/tools/generate.jam
diff options
context:
space:
mode:
authorPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-11-05 15:29:46 +0100
committerPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-11-05 15:29:46 +0100
commit6f29f345dc06c1a1033475eac1d1340781d1d603 (patch)
tree6fa4cdd7aefd7d54c9585c2c6274db61bb8b159a /jam-files/boost-build/tools/generate.jam
parentb510da2e562c695c90d565eb295c749569c59be8 (diff)
parentc615c37501fa8576584a510a9d2bfe2fdd5bace7 (diff)
merge upstream/master
Diffstat (limited to 'jam-files/boost-build/tools/generate.jam')
-rw-r--r--jam-files/boost-build/tools/generate.jam108
1 files changed, 0 insertions, 108 deletions
diff --git a/jam-files/boost-build/tools/generate.jam b/jam-files/boost-build/tools/generate.jam
deleted file mode 100644
index 6732fa35..00000000
--- a/jam-files/boost-build/tools/generate.jam
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright 2006 Vladimir Prus
-# Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
-
-# Declares main target 'generate' used to produce targets by calling a
-# user-provided rule that takes and produces virtual targets.
-
-import "class" : new ;
-import errors ;
-import feature ;
-import project ;
-import property ;
-import property-set ;
-import targets ;
-import regex ;
-
-
-feature.feature generating-rule : : free ;
-
-
-class generated-target-class : basic-target
-{
- import errors ;
- import indirect ;
- import virtual-target ;
-
- rule __init__ ( name : project : sources * : requirements *
- : default-build * : usage-requirements * )
- {
- basic-target.__init__ $(name) : $(project) : $(sources)
- : $(requirements) : $(default-build) : $(usage-requirements) ;
-
- if ! [ $(self.requirements).get <generating-rule> ]
- {
- errors.user-error "The generate rule requires the <generating-rule>"
- "property to be set" ;
- }
- }
-
- rule construct ( name : sources * : property-set )
- {
- local result ;
- local gr = [ $(property-set).get <generating-rule> ] ;
-
- # FIXME: this is a copy-paste from virtual-target.jam. We should add a
- # utility rule to call a rule like this.
- local rule-name = [ MATCH ^@(.*) : $(gr) ] ;
- if $(rule-name)
- {
- if $(gr[2])
- {
- local target-name = [ full-name ] ;
- errors.user-error "Multiple <generating-rule> properties"
- "encountered for target $(target-name)." ;
- }
-
- result = [ indirect.call $(rule-name) $(self.project) $(name)
- : $(property-set) : $(sources) ] ;
-
- if ! $(result)
- {
- ECHO "warning: Unable to construct" [ full-name ] ;
- }
- }
-
- local ur ;
- local targets ;
-
- if $(result)
- {
- if [ class.is-a $(result[1]) : property-set ]
- {
- ur = $(result[1]) ;
- targets = $(result[2-]) ;
- }
- else
- {
- ur = [ property-set.empty ] ;
- targets = $(result) ;
- }
- }
- # FIXME: the following loop should be doable using sequence.transform or
- # some similar utility rule.
- local rt ;
- for local t in $(targets)
- {
- rt += [ virtual-target.register $(t) ] ;
- }
- return $(ur) $(rt) ;
- }
-}
-
-
-rule generate ( name : sources * : requirements * : default-build *
- : usage-requirements * )
-{
- local project = [ project.current ] ;
-
- targets.main-target-alternative
- [ new generated-target-class $(name) : $(project)
- : [ targets.main-target-sources $(sources) : $(name) ]
- : [ targets.main-target-requirements $(requirements) : $(project) ]
- : [ targets.main-target-default-build $(default-build) : $(project) ]
- : [ targets.main-target-usage-requirements $(usage-requirements) : $(project) ]
- ] ;
-}
-
-IMPORT $(__name__) : generate : : generate ;