Tim\'s picture      Blogging Ottinger (tim)

2007-June-14

Debugging a makefile

Filed under: Linux, Windows, Programming

When make works, it’s great. When it fails, it’s awful.

A nice trick is to create a new target, right up at the top of the file where it becomes the new default target, give it no dependencies (unless you want to test the dependent build, I guess) and have it echo variables to stdout. This is how I found out that I had an extra space appended to one of my path variables, which was really screwing up make.

     madness:
        echo \"VAR1 is \" $(VAR1)
        echo \"VAR2 is \" $(VAR2)

This was enough to solve my problem. Hope it’s useful for yours, whatever it may be.

Comments »

The URI to TrackBack this entry is: http://tottinge.blogsome.com/2007/06/14/debugging-a-makefile/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome | Theme designs available here