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
June 24th, 2008 at 5:59 pm
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…
June 24th, 2008 at 9:15 pm
Yeah, the echo-variable-% rule is really very helpful when debugging build stuff.
June 24th, 2008 at 11:37 pm
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. :-)
July 6th, 2008 at 10:01 pm
perhaps this could/should be published on MDC, for best discoverability.