1# Copyright 2017 Peter Dimov 2# 3# Distributed under the Boost Software License, Version 1.0. 4# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 5 6import modules ; 7import sequence ; 8import set ; 9import project ; 10import virtual-target ; 11import testing ; 12import ac ; 13 14project : requirements -<link>static ; # from tools/Jamfile 15 16if "--debug-check-build" in [ modules.peek : ARGV ] 17{ 18 .info-enabled = 1 ; 19} 20 21local rule .info ( messages * ) 22{ 23 if $(.info-enabled) 24 { 25 ECHO "info:" $(messages) ; 26 } 27} 28 29local all-libraries = [ MATCH .*libs/(.*)/build/.* : 30 [ glob ../../../libs/*/build/Jamfile.v2 ] 31 [ glob ../../../libs/*/build/Jamfile ] ] ; 32 33all-libraries = [ sequence.unique $(all-libraries) ] ; 34 35# The function_types library has a Jamfile, but it's used for maintenance 36# purposes, there's no library to build and install. 37 38all-libraries = [ set.difference $(all-libraries) : function_types ] ; 39 40#ECHO all-libraries: $(all-libraries) ; 41 42rule alias-sources-impl ( project name : property-set : sources * ) 43{ 44 local target-graph ; 45 46 for local s in $(sources) 47 { 48 target-graph += [ virtual-target.traverse $(s) : include-sources : include-roots ] ; 49 } 50 51 # Remove targets created by the main target 52 53 local result ; 54 55 for local t in $(target-graph) 56 { 57 if [ $(t).root ] && ! ( $(t) in $(sources) ) && ( [ $(t).type ] = STATIC_LIB || [ $(t).type ] = SHARED_LIB ) 58 { 59 result += $(t) ; 60 } 61 } 62 63 .info "$(name):" ; 64 65 for local t in $(result) 66 { 67 .info " " [ $(t).name ] ; 68 } 69 70 return $(result) ; 71} 72 73path-constant ROOT : ../../.. ; 74 75for local lib in $(all-libraries) 76{ 77 local path = [ NORMALIZE_PATH /$(ROOT)/libs/$(lib)/build ] ; 78 generate library-$(lib) : $(path)//stage : <generating-rule>@alias-sources-impl ; 79} 80 81for local lib in $(all-libraries) 82{ 83 local python-dep ; 84 85 if $(lib) in python mpi graph_parallel 86 { 87 python-dep = /python//python ; 88 } 89 90 run main.cpp : : : [ ac.check-library library-$(lib) : <library>library-$(lib) <library>$(python-dep) : <build>no ] : $(lib) ; 91} 92