Boost logo

Boost-Build :

Subject: [Boost-build] Implementing a complex Makefile process in Jam/Boost.Build
From: Scott Long (smxlong_at_[hidden])
Date: 2009-03-27 00:16:12


I'm trying to move my project's build system from GNU make to
Jam/Boost.Build. I have a rather complicated build step which creates
a library of code stubs. I was wondering how to represent this process
in Jam.

The following ASCII diagram represents the process. The idea is to
take a C source file which defines a routine which will be injected
into another process. The process goes:

1. Compile the C module to get an object
2. Link this object with a utility object, using a linker script to
control the layout
3. Translate the resulting ELF binary to a raw binary form
4. Pass this raw binary through a utility which turns it into a C
array of byte values
5. Compile this C module into an object
6. Archive this object into a library.

The dependencies for this process are the "stubN.c" file, the linker
map file "ldscript", the utility module "util.c", and the source code
to the MakeBin utility, "MakeBin.c". In reality, there is more than
one "stubN.c" file.

In the diagram, I have represented dependencies in '@' boxes. Build
steps are represented in '#' boxes. And intermediate files are in '*'
boxes.

I am looking for guidance, not total handholding, in how to translate
this process to Jam.

Thanks. The diagram follows this signature. It should appear correctly
if you use a fixed-width font, with 80 columns.

Scott Long

                  @@@@@@@@@@@@@@@
                  @ stubN.c @
                  @@@@@@@@@@@@@@@
                         |
                         V
                  ############### @@@@@@@@@@@@@@@
                  # gcc # @ util.c @
                  ############### @@@@@@@@@@@@@@@
                         | |
                         V V
                  *************** ###############
                  * stubN.o * # gcc #
                  *************** ###############
                         | |
                         V V
@@@@@@@@@@@@@@@ ############### ***************
@ ldscript @ -> # ld # <- * util.o *
@@@@@@@@@@@@@@@ ############### ***************
                         |
                         V
                  *************** @@@@@@@@@@@@@@@
                  * stubN * @ MakeBin.c @
                  *************** @@@@@@@@@@@@@@@
                         | |
                         V V
                  ############### ###############
                  # objcopy # # gcc #
                  ############### ###############
                         | |
                         V V
                  *************** ***************
                  * stubN.bin * * MakeBin.o *
                  *************** ***************
                         | |
                         V V
                  ############### ###############
                  # MakeBin # <- # link #
                  ############### ###############
                         |
                         V
                  ***************
                  * stubN.bin.c *
                  ***************
                         |
                         V
                  ###############
                  # gcc #
                  ###############
                         |
                         V
                  ***************
                  * stubN.bin.o *
                  ***************
                         |
                         V
                  ###############
                  # ar #
                  ###############
                         |
                         V
                  ***************
                  * libstub.a *
                  ***************


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk