pymake

  • Revision slug: pymake
  • Revision title: pymake
  • Revision id: 10797
  • Created:
  • Creator: bgirard
  • Is current revision? No
  • Comment 1 words removed

Revision Content

make.py (and the pymake modules that support it) are an implementation of the make tool which are mostly compatible with makefiles written for GNU make. http://benjamin.smedbergs.us/pymake/

Prerequisites

You need to have MozillaBuild installed.  Additionally, if you don't have the latest MozillaBuild version, you could need to ensure your mingw shell is instructed to export SHELL (exactly that) before you try to run pymake.

Usage

Follow the build instructions, except for the "Build and install" section, then:

  • Create your objdir
  • Change to your objdir and run python -O path_to_srcdir/build/pymake/make.py -f path_to_srcdir/client.mk
    • On Windows, you may need to use a relative path when pointing pymake to your client.mk file so that it will do a relative configure, as noted here: Gmake vs Pymake
    • When building comm-central, use path_to_srcdir/mozilla/build/pymake/make.py
  • On Windows, these steps might work better:
    • Create your objdir. Ensure that it is empty if you previously used regular make to build in this objdir.
    • Ensure that your .mozconfig does not contain a MOZ_OBJDIR= directive. If it does, pymake will fail.
    • Ensure that you have a MOZCONFIG environment variable pointing to your .mozconfig file, since you are building from your objdir.
    • Change to your objdir and run ../configure
      • Use 'pymake -f client.mk build' from path_to_srcdir if configure is missing (if you haven't built yet).
    • Still from your objdir, run python -O "..\build\pymake\make.py" -s
      • You might want to pass something like -j4 so that it uses multiple cores if you've got them.

Alternate Usage

Follow the build instructions, except for the "Build and install" section, then:

  • Switch to the root of the source directory, then run autoconf-2.13.
  • Change to js/src and run autoconf-2.13 again.
  • Create your objdir.
  • Finally, change to your objdir and run path_to_srcdir/configure.

Running python -O path_to_srcdir/build/pymake/make.py starts the build. Add -j2 to the command line to do a parallel build (MOZ_MAKE_FLAGS in your mozconfig is not used by pymake). Using a -j value equal to the number of CPU cores visible to the OS is recommended.

After updating your source, it's a good idea to redo the autoconf-2.13 and configure steps before building, whether it be an incremental or full build.

Revision Source

<p>make.py (and the pymake modules that support it) are an implementation of the make tool which are mostly compatible with makefiles written for GNU make. <a class=" external" href="http://benjamin.smedbergs.us/pymake/" title="http://benjamin.smedbergs.us/pymake/">http://benjamin.smedbergs.us/pymake/</a></p>
<h3>Prerequisites</h3>
<p>You need to have <a href="/En/Developer_Guide/Build_Instructions/Windows_Prerequisites#MozillaBuild" title="En/Developer Guide/Build Instructions/Windows Prerequisites#MozillaBuild">MozillaBuild</a> installed.  Additionally, if you don't have the latest MozillaBuild version, you could need to ensure your mingw shell is instructed to <code>export SHELL</code> (exactly that) before you try to run pymake.</p>
<h3>Usage</h3>
<p>Follow the <a href="/En/Developer_Guide/Build_Instructions" title="En/Developer Guide/Build Instructions">build instructions</a>, except for the "Build and install" section, then:</p>
<ul> <li>Create your objdir</li> <li>Change to your objdir and run <code>python -O <strong>path_to_srcdir/</strong>build/pymake/make.py -f <strong>path_to_srcdir/</strong></code><code>client.mk</code> <ul> <li>On Windows, you may need to use a relative path when pointing pymake to your client.mk file so that it will do a relative configure, as noted here: <a href="/en/Gmake_vs._Pymake" title="https://developer.mozilla.org/en/Gmake_vs._Pymake">Gmake vs Pymake</a></li> <li>When building comm-central, use <code><strong>path_to_srcdir/</strong>mozilla/build/pymake/make.py</code><span style="font-family: Verdana;"><code><br> </code></span></li> </ul> </li> <li>On Windows, these steps might work better: <ul> <li>Create your objdir. Ensure that it is empty if you previously used regular make to build in this objdir.</li> <li>Ensure that your <code>.mozconfig</code> does not contain a <code>MOZ_OBJDIR=</code> directive. If it does, pymake will fail.</li> <li>Ensure that you have a <code>MOZCONFIG</code> environment variable pointing to your <code>.mozconfig</code> file, since you are building from your objdir.</li> <li>Change to your objdir and run <code>../configure</code> <ul> <li>Use 'pymake -f client.mk build' from <code><strong>path_to_srcdir</strong></code> if <code>configure</code> is missing (if you haven't built yet).</li> </ul> </li> <li>Still from your objdir, run <code>python -O "..\build\pymake\make.py" -s</code> <ul> <li>You might want to pass something like <code>-j4</code> so that it uses multiple cores if you've got them.</li> </ul> </li> </ul> </li>
</ul>
<h4>Alternate Usage</h4>
<p>Follow the <a href="/En/Developer_Guide/Build_Instructions" title="En/Developer Guide/Build Instructions">build instructions</a>, except for the "Build and install" section, then:</p>
<ul> <li>Switch to the root of the source directory, then run <code>autoconf-2.13</code>.</li> <li>Change to <code>js/src</code> and run <code>autoconf-2.13</code> again.</li> <li>Create your objdir.</li> <li>Finally, change to your <code>objdir</code> and run <code><strong>path_to_srcdir/</strong>configure</code>.</li>
</ul>
<p>Running <code>python -O <strong>path_to_srcdir/</strong>build/pymake/make.py</code> starts the build. Add <code>-j2</code> to the command line to do a parallel build (MOZ_MAKE_FLAGS in your mozconfig is not used by pymake). Using a <code>-j</code> value equal to the number of CPU cores visible to the OS is recommended.</p>
<p>After <a href="/En/Developer_Guide/Build_Instructions#Get_the_source" title="En/Developer Guide/Build Instructions#Get the source">updating your source</a>, it's a good idea to redo the <strong>autoconf-2.13</strong> and <strong>configur</strong><strong>e</strong> steps before building, whether it be an <a href="/en/Incremental_Build" title="en/Incremental Build">incremental</a> or full build.</p>
Revert to this revision