Next: , Previous: Building all main programs from a single project tree, Up: Aggregate Projects

11.7.2 Building a set of projects with a single command

One other case is when you have multiple applications and libraries that are build independently from each other (but they can be build in parallel). For instance, you have a project tree rooted at A, and another one (which might share some subprojects) rooted at B.

Using only gprbuild, you could do

       gprbuild -PA.gpr
       gprbuild -PB.gpr

to build both. But again, gprbuild has to do some duplicate work for those files that are shared between the two, and cannot truly build things in parallel efficiently.

If the two projects are really independent, share no sources other than through a common subproject, and have no source files with a common basename, you could create a project C that imports A and B. But these restrictions are often too strong, and one has to build them independently. An aggregate project does not have these limitations, and can aggregate two project trees that have common sources.

     Aggregate projects can group projects with duplicate file names

This scenario is particularly useful in environment like VxWork 653 where the applications running in the multiple partitions can be build in parallel through a single gprbuild command. This also works nicely with Annex E.

        Aggregate projects can be used to build multiple partitions