Adding Files to the Build
From MDC
So you want to add something (and not break the build) ...
All platforms are now using the same set of Makefiles for the build, so, finally, all you have to do are edit Makefile.in files (and possibly mozilla/allmakefiles.sh if you add new makefiles).
[edit] Adding files to the build
- All platforms use
Makefile.infiles now. Edit these to add new source files, and export header files. - Dependencies are specified in
Makefile.intoo - If you add a new directory to the build, you have to add an entry for its Makefile in the directory list in
mozilla/allmakefiles.sh, as well as adding the directory to the list of subdirs in../Makefile.in. - On platforms that build with gcc, because of the symbol visibility, you might have to check System Headers to make sure they are properly wrapped.
[edit] Checking In
Adding new files to the build can cause breakage on tinderbox and to other developers if things aren't checked in the correct order.
- Check in only the new files.
- Check in the patches to existing files that make your new files get used.
[edit] Exporting Files
Exporting a file makes it get copied to mozilla/dist. C and C++ header files are exported by including them the EXPORTS list in Makefile.in, and IDL files are exported by including them in the XPIDLSRCS list.
[edit] XPInstall
If you create something that needs to be present in an end-user distribution then don't forget to add it to the proper xpinstall packages. Add your file to the appropriate places (depending on where it's needed) in mozilla/xpinstall/packager/packages-win or mozilla/xpinstall/packager/xpcom-win.pkg (GRE), mozilla/xpinstall/packager/packages-static-win, mozilla/xpinstall/packager/packages-unix, mozilla/xpinstall/packager/packages-static-unix, and mozilla/xpinstall/packager/packages-os2. If your new files are needed by embedders, then also add them to the appropriate lists in mozilla/embedding/config/basebrowser-*.
Neglecting to add your new files to xpinstall packages means that your new feature will work when you run it from your own tree, but will break in packages distributed to actual end users.
[edit] Original Document Information
- Author(s): Akkana Peck
- Last Updated Date: May 28, 2007
- Copyright Information: Portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a Creative Commons license | Details.