Mozilla Build Tricks: viewing preprocessed source

More in the occasional series of tricks you can do with the Mozilla build system.

Making Preprocessed Sources

If you have a compile error and you can’t figure out what macros are being expanded, you can make a preprocessed version of any C/C++ file:

$ cd $OBJDIR/some/directory
$ make nsMyFilename.i

Using Doxygen to Generate Documentation

You can use the documentation-generation tool Doxygen to automatically generate interface/class/method documentation from the Mozilla sources.

$ cd $OBJDIR
$ make documentation

Warning: doxygen isn’t especially precise. Your mileage may vary.

Displaying a Build Variable

Sometimes when hacking a Makefile it may not be obvious what the final value of a variable is. You can check this by using the echo-variable-% rule:

$ cd $OBJDIR/some/directory
$ make echo-variable-EXTRA_DSO_LDOPTS

Atom Feed for Comments 4 Responses to “Mozilla Build Tricks: viewing preprocessed source”

  1. Joshua Cranmer Says:

    I’ve known and used the doxygen and build variable portions multiple times (heck, I’m making |make documentation| better via bug 433206).

    But I never knew about the preprocessed stuff…

  2. byang Says:

    Yeah, the echo-variable-% rule is really very helpful when debugging build stuff.

  3. Smokey Ardisson Says:

    I would have loved to have known the echo-variable trick for something I was working on several months ago. I’ll file it away for future reference, though. :-)

  4. Justin Wood (Callek) Says:

    perhaps this could/should be published on MDC, for best discoverability.

Leave a Reply