Mozilla Build Tricks: viewing preprocessed source

Tuesday, June 24th, 2008

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