spacer

Tools

Tweet
spacer spacer Permalink

Debugging Makefiles

By John Graham-Cumming, February 05, 2007

John shares practical debugging tips he's used to debug real-world Makefiles.
John is a cofounder of Electric Cloud, which focuses on reducing software build times. He can be contacted at jgc@electric-cloud.com.


Donald Knuth once said that, given a choice between two languages, he'd choose the one with the better debugger. For that reason, he'd probably never choose to use Make. Its debugging facilities are virtually nonexistent.

In this article, I address this problem by providing practical debugging tips I've used to debug real-world Makefiles. To illustrate, I use GNU Make because of its wide platform support and rich language. Unfortunately, that rich language doesn't include much in the way of debugging. In fact, GNU Make's -d command-line flag seems to produce output more useful to the author of GNU Make than to someone facing Makefile problems.

The only GNU Make command-line option that's really useful for Makefile debugging is -p, and all it does is dump the contents of GNU Make's built-in rules and macros, and any rules or macros defined in the Makefile. Granted, that's an enormous amount of information that can be useful in debugging, but hardly counts as a debugger.

Broadly, Makefile debugging problems fall into three categories:

  • What's the value of macro X and how did it get it?
  • Why did file foo get built?
  • How does Make log file output relate to the rules in the Makefile?



1 2 3 4 Next 

Related Reading

  • News
  • Commentary

News

  • Hosted TFS Server 2012 From Dynamsoft
  • Forget Cross Platform, Try Massively Cross Platform
  • Windows Phone 8 Developer Platform Is Here
  • Zend To Support Mobile First, Cloud First Development
  • More News»

Commentary

  • Toyota's Kanban Is Still Driving Agile
  • Splunk Enterprise 5 Arrives
  • Big Data Was A Data Play, Now It's A Developer Play
  • Creating and Using Libraries with OpenACC
  • More Commentary»
  • Most Popular
  • On the Web

Most Popular

  • The Enduring Challenge of Compressing Random Data
  • volatile: The Multithreaded Programmer's Best Friend
  • Microsoft Build Details The C++ State Of The Nation
  • Read/Write Properties Files in Java
  • More Popular»

On the Web

  • Cloud Connect 2012 Speaker List: Mat Ellis Founder and CEO, Cloudability
  • Real Bonding With Family Around the TV Via Skype
  • NIST, DHS trying to tame cyber workforce definitions
  • Automated EMR Search Speeds ED Evaluations
  • More On The Web»
  • Slideshow
  • Video

Slideshow

  • Jolt Awards: Utilities
  • Dr. Dobb's 2012 Salary Survey
  • Developer's Reading List
  • A Look at the Main JVM Languages Today
  • More Slideshows»

Video

  • End-To-End Developer Testing
  • NASA's Mars Curiosity
  • Atlassian Summit
  • Former Hacker: Software Should Be More Secure
  • More Videos»

More Insights

White Papers

  • Big Data Analytics Guide 2012
  • Managing threats in the digital age
More >>

Reports

  • Research: Federal IT Priorities: Focus On The Foundation
  • Research: App Dev in the Age of Mobility
More >>

Webcasts

  • The Latest in Advanced Product Personalization
  • Which data compression technology should you choose? An Edison perspective
More >>

INFO-LINK
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.