Question

As an exercise and in an effort to (better understand|help other people better understand) the build process at my company, I am hoping to create a directed acyclic graph of the build process.

The current build process at my work is, as I understand, is essentially running nmake on a makefil at the root build directory. This makefile that specifies a list of components to build and for each component the build script recurses to build sub-components, sub-sub-components, etc. Certain components are built into DLL/Libs which can be used for linking against when building other components, this relationship would be a dependency. I.e. if component B links against the lib file of component A, component A is a dependency of component B.

What I'm looking for is example code of how this would be done as I'm still learning about programming. Any suggestion would be appreciated, thanks!

Was it helpful?

Solution

Makefile::GraphViz can probably help here.

OTHER TIPS

The command NMAKE /N /P will dump out the dependency relationships for the makefile, but not build anything.

The output is like this


obj\statbar.obj:
        flags:  -s
        dependents:     statbar.cpp obj\precomp.obj res\resource.h sfapp.h
                        frame.h prefs.h appopen.h
        commands:

obj\appopen.obj:
        flags:  -s
        dependents:     appopen.cpp obj\precomp.obj res\resource.h sfapp.h
                        frame.h prefs.h appopen.h
        commands: 

The output is pretty regular, You could parse it and use it build your graph.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top