Development:Building:Common make Targets
Jump to navigation
Jump to search
You can run make with several different targets to perform various tasks. Most interesting make targets can be found in mozilla/client.mk and various Makefiles, such as mozilla/camino/Makefile.in and mozilla/camino/installer/Makefile.in.
client.mk
Unless otherwise noted, all targets can be used with both make in the $OBJDIR and make -f client.mk in the $SRCDIR (or make in the $SRCDIR in a srcdir build after the initial client.mk-driven build).
build- This target triggers a full Mozilla build without performing a checkout (or update) first (this can only be used withmake -f client.mkin the$SRCDIR; in the$OBJDIR,makewith no target is the equivalent).
checkout- This target triggers a Mozilla cvs checkout (or update of an existing checkout) without subsequently performing a build (for obvious reasons, this can only be used withmake -f client.mkin the$SRCDIR).
clean- Removes the object files and other generated files, as well as any files or directories in theGARBAGEorGARBAGE_DIRSMakefile variables (can only be used in the$OBJDIRin OBJDIR builds and in the$SRCDIRin non-OBJDIR builds).
distclean- Likeclean, this removes intermediate build products (like object files), but it also removes any and all final build products indist/(can only be used in the$OBJDIRin OBJDIR builds and in the$SRCDIRin non-OBJDIR builds).
export-exportis usually the first target run bybuildor a stand-alonemake; it configures the build, generates headers from IDL files, and exports various headers to locations where other parts of the build process can find them. There are few situations where you would run this target by itself in a full Mozilla build.
camino/Makefile.in
Camino shares many of the targets above with client.mk; running the client.mk target will also run the corresponding Camino target.
clean- Removes the object files and other generated files, thebuilddirectory, as well as any files or directories in theGARBAGEorGARBAGE_DIRSvariables of Camino Makefiles (can only be used in the$OBJDIRin OBJDIR builds and in the$SRCDIRin non-OBJDIR builds).
distclean- Likeclean, this removes intermediate build products (like object files), but it also removes any of Camino's final build products indist/(can only be used in the$OBJDIRin OBJDIR builds and in the$SRCDIRin non-OBJDIR builds).
export- For Camino, when first called byclient.mk’sexporttarget, theexporttarget sets up the Camino part of the OBJDIR. This involves symlinking thewalletfiles and most source directories and copying the project files without clobbering the personal settings contained within. You should re-run this target in your$OBJDIReach time the project file is updated, when the Makefile itself changes (it will update itself in the OBJDIR), or when a new subdirectory is added tomozilla/camino.
libs- This target is rarely called directly; however, it is the meat of a Camino build. The targets it depends on generate all of the Camino files that depend on preprocessing (e.g.,all-camino.js,Info.plist, and all of theLocalizable.stringsand other.stringsfiles. This target is also responsible for theembed-replacementssystem, for callingxcodebuildin the initial Mozilla build and in command-line Camino builds, copying the final Camino application todist/, and handling thexptfiles. After any.stringsfile changes, any updates to the Gecko milestone, or Camino version number change, the various dependent targets need to be re-run; the simplest way to do this is to simplymakein$OBJDIR/camino(ormozilla/caminoin a srcdir build).- N.B. Camino also has certain “external” pieces of code that are built only by recursive
makeand not by separate Camino Makefile targets or by project-related dependencies. If you do notmakein Camino after these pieces of code are added or modified, your Xcode build will fail or will not pick up the changes.
- N.B. Camino also has certain “external” pieces of code that are built only by recursive
Other useful make tricks
make is also capable of rebuilding directories selectively using -C directory rather than performing a full recursive build. Some scenarios where this is useful include:
- Widget code - You've made changes to Cocoa widget code; as described in the build instructions, you can
makein the Widget directory and then Camino to get the Widget changes into your build. From the root of your$OBJDIR, run the following command:make -C widget/src/cocoa; make -C embedding/config; make -C camino
- Packaging a build - If you have a static build you want to distribute, you need to make in
camino/installerto invoke the packaging mechanism. After making sure you have run a command-line build in Camino (to ensure all of the steps in thelibstarget have run,make -C installer; open ../distfrom$OBJDIR/caminoto generate the disk image and open thedist/directory. (If you have a Universal build and you only want to package one half, ensure you are in the appropriate architecture subdirectory—$OBJDIR/ppc/caminoor$OBJDIR/i386/camino—and runmake -C installer UNIVERSAL_BINARY=.) N.B. There is some situation in which you will need to do a full build frommake -f client.mk buildbefore performing packaging; I can't remember what that is right now, though.
- Rebuilding an “external” piece of Camino - Some “external” Camino dependencies (those bits of code in directories sitting directly in
mozilla/caminorather than inmozilla/camino/src) have their own makefiles and can be built separately (they are normally built by recursivemakefromcamino). If you were hacking on the feedhandlers or Flashblock, you may wish to check your changes by simply rebuilding them rather than all of Camino; from$OBJDIR/camino, runmake -C feedhandlersormake -C flashblockto build these pieces. External pieces that are built using Xcode projects can generally not be built in this manner.