Incremental Build

  • Revision slug: Incremental_Build
  • Revision title: Incremental Build
  • Revision id: 65611
  • Created:
  • Creator: Ehsan
  • Is current revision? No
  • Comment Correct the static build link

Revision Content

{{ :en/Build_Documentation/TOC() }}

Now that you have set up and built your source tree for the first time, you're ready to start your own development cycle.

The best way to proceed is to use an Objdir approach. For example, if you're enhancing Mozilla storage and have made changes to <tt>mozStorageConnection.cpp</tt>.

Assuming that your Objdir has already been built and you used separate shared libraries build options, you will find that the corresponding <tt>components</tt> folder (for Thunderbird in this example) contains these files that include compiled <tt>mozStorageConnection.cpp</tt> functions (note that "obj-i686-pc-cygwin" might be different in your case):

/c/mozilla/obj-i686-pc-cygwin/dist/bin/components:
...
storage.xpt
strgcmps.dll
...

To incrementally rebuild Mozilla Storage component to reflect your changes in <tt>mozStorageConnection.cpp</tt>, you need to run <tt>make</tt> in the corresponding Objdir subfolder:

cd /c/mozilla/obj-i686-pc-cygwin/storage
make

Note that there's a time stamp change on the components files after <tt>make</tt> completes:

/c/mozilla/obj-i686-pc-cygwin/dist/bin/components:
...
storage.xpt
strgcmps.dll
...

Now you should be able to run your updated Thunderbird:

/c/mozilla/obj-i686-pc-cygwin/dist/bin/thunderbird.exe

Two-stage build

Many components build in sections, with a master build subdirectory that links the component together. Usually this build subdirectory lives under the component's main directory, but not always. When modifying files in subfolders of uriloader you also need to make in /c/mozilla/docshell/build and when modifying files in subfolders of content, dom, editor or view you also need to make in /c/mozilla/layout/build (except when building versions prior to 1.9 where editor has its own build subdirectory).

Using sourcedir builds

When using a srcdir build you're typically editing in a subdirectory of the component's main directory. However you can leverage the two-stage build to your benefit. Simply run make in the current directory to compile the modified source files, then run make in the component's build directory or in the alternative build directory in the cases listed above to link the component. This is particularly convenient when your editor invokes make and processes any error output.

Build times

To give you a rough idea, here some build times on an “average Windows XP PC”:

  • full build: 2 hrs (<tt>make clean; make all;</tt> - from top of source tree)
  • full dependency build: 30 min (<tt>make deps;</tt> - from top of source tree)
  • local incremental build: 1 min (<tt>make;</tt> - from <tt><objdir>/storage</tt>)

Revision Source

<p>
{{ :en/Build_Documentation/TOC() }}
</p><p>Now that you have <a href="en/Build_and_Install">set up and built</a> your source tree for the first time, you're ready to start your own development cycle. </p><p>The best way to proceed is to use an <a href="en/Configuring_Build_Options#Building_with_an_Objdir">Objdir</a> approach. For example, if you're enhancing <a class="external" href="http://lxr.mozilla.org/mozilla/source/storage/">Mozilla storage</a> and have made changes to <tt><a class="external" href="http://lxr.mozilla.org/mozilla/source/storage/src/mozStorageConnection.cpp">mozStorageConnection.cpp</a></tt>. </p><p>Assuming that your Objdir has <a href="en/Build_and_Install">already been built</a> and you used <a href="en/Configuring_Build_Options#Statically_Linking_Components">separate shared libraries build options</a>, you will find that the corresponding <tt>components</tt> folder (for Thunderbird in this example) contains these files that include compiled <tt>mozStorageConnection.cpp</tt> functions (note that "<i>obj-i686-pc-cygwin</i>" might be different in your case):
</p>
<pre class="eval">/c/mozilla/obj-i686-pc-cygwin/dist/bin/components:
...
storage.xpt
strgcmps.dll
...
</pre>
<p>To incrementally rebuild Mozilla Storage component to reflect your changes in <tt>mozStorageConnection.cpp</tt>, you need to run <tt>make</tt> in the corresponding Objdir subfolder:
</p>
<pre class="eval">cd /c/mozilla/obj-i686-pc-cygwin/storage
make
</pre>
<p>Note that there's a time stamp change on the components files after <tt>make</tt> completes:
</p>
<pre class="eval">/c/mozilla/obj-i686-pc-cygwin/dist/bin/components:
...
storage.xpt
strgcmps.dll
...
</pre>
<p>Now you should be able to run your updated Thunderbird:
</p>
<pre class="eval">/c/mozilla/obj-i686-pc-cygwin/dist/bin/thunderbird.exe
</pre>
<h3 name="Two-stage_build"> Two-stage build </h3>
<p>Many components build in sections, with a master build subdirectory that links the component together. Usually this build subdirectory lives under the component's main directory, but not always. When modifying files in subfolders of uriloader you also need to make in /c/mozilla/docshell/build and when modifying files in subfolders of content, dom, editor or view you also need to make in /c/mozilla/layout/build (except when building versions prior to 1.9 where editor has its own build subdirectory).
</p>
<h4 name="Using_sourcedir_builds"> Using sourcedir builds </h4>
<p>When using a srcdir build you're typically editing in a subdirectory of the component's main directory. However you can leverage the two-stage build to your benefit. Simply run make in the current directory to compile the modified source files, then run make in the component's build directory or in the alternative build directory in the cases listed above to link the component. This is particularly convenient when your editor invokes make and processes any error output.
</p>
<h3 name="Build_times"> Build times </h3>
<p>To give you a rough idea, here some build times on an “average Windows XP PC”:
</p>
<ul><li> full build: 2 hrs (<tt>make clean; make all;</tt> - from top of source tree)
</li><li> full dependency build: 30 min (<tt>make deps;</tt> - from top of source tree)
</li><li> local incremental build: 1 min (<tt>make;</tt> - from <tt>&lt;objdir&gt;/storage</tt>)
</li></ul>
Revert to this revision