Difference between revisions of "Debugging Makefiles"

From eLinux.org
Jump to: navigation, search
(Makefile Debugger: re-arrange links)
Line 14: Line 14:
 
== Makefile Debugger ==
 
== Makefile Debugger ==
 
John has also written a Makefile Debugger.
 
John has also written a Makefile Debugger.
The following resources are needed to use this debugger:
+
 
 +
The following articles describe the debugger and how to use it:
 +
* [http://www.cmcrossroads.com/content/view/6479/120/ An Interactive GNU Make Debugger]
 +
* [http://www.cmcrossroads.com/content/view/6529/120/ Dynamic Breakpoints in the GNU Make Debugger]
 +
 
 +
The following resources are needed to use the debugger:
  
 
* Download gmsl (a library of gnu make stuff), from http://gmsl.sf.net/
 
* Download gmsl (a library of gnu make stuff), from http://gmsl.sf.net/
Line 29: Line 34:
 
  all:
 
  all:
 
         $(__BREAKPOINT)
 
         $(__BREAKPOINT)
 
See the following articles for more information:
 
* [http://www.cmcrossroads.com/content/view/6479/120/ An Interactive GNU Make Debugger]
 
* [http://www.cmcrossroads.com/content/view/6529/120/ Dynamic Breakpoints in the GNU Make Debugger]
 

Revision as of 18:34, 13 June 2008

Here is some information on debugging Makefiles:

showing symbol values, and showing file dependencies

There's a good Dr. Dobbs article on this topic, by John Graham-Cumming, at:

or printable, all-in-one page, at http://www.embedded.com/columns/technicalinsights/197003517?printable=true

This article describes some macros you can put in your Makefiles to show you the values of symbols, and to show the dependencies that led to a particular target being built. This is handy if you have a complex Makefile that you are trying to debug.

Makefile Debugger

John has also written a Makefile Debugger.

The following articles describe the debugger and how to use it:

The following resources are needed to use the debugger:

Expand the tarballs from these, and place __gmsl, gmsl and gmd in the directory with the Makefile you wish to debug.

Add the following lines to your Makefile:

include gdm

and

all:
        $(__BREAKPOINT)