MDN may have intermittent access issues April 18 13:00 - April 19 01:00 UTC. See whistlepig.mozilla.org for all notifications.

mozilla

Revision 334661 of pymake

  • Revision slug: pymake
  • Revision title: pymake
  • Revision id: 334661
  • Created:
  • Creator: gps
  • Is current revision? No
  • Comment

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.

Prerequisites

If running Windows, you need to have a Windows build environment installed for using pymake to build Mozilla.

On other operating systems (Linux, OS X, etc), pymake itself only requires Python 2.6 or higher (but not Python 3). Please note that Python 2.7 is strongly recommended.

Usage

If you use mach for everything, you don't have to worry about gmake and pymake: mach will run whatever is best for the current machine.

Note: On Windows, you must take special care to be able to switch back and forth between gmake and pymake on the same object dir. See Gmake vs. Pymake for more information.

Anywhere you would normally type make, instead type python /path/to/srcdir/build/pymake/make.py.  For example:

  • Instead of make -f client.mk to start a build, you would type python build/pymake/make.py -f client.mk.
  • To run tests instead of typing make mochitest-plain in the object directory, you would type python ../build/pymake/make.py mochitest-plain.

Alternately, if you would like to simply type in pymake -f client.mk from within the MINGW32 shell.

  • While in the shell type cd ~ (without quotes).
  • Type touch .profile
  • Using any appropriate text editor open .profile and add the following line in the file (assuming your mozilla-central is at C:/mozilla-central, if not, adjust your path accordingly.)

alias pymake=C:/mozilla-central/build/pymake/make.py

  • Save your .profile edit and close the shell, then restart the shell.
  • Try typing just pymake into the shell and press enter.  This should come back with "No makefile found." If it does, your pymake alias is connected and you are ready to type in pymake -f client.mk to start the build.

Unlike gmake on Windows, pymake is capable of doing parallel builds, so you can set a MOZ_MAKE_FLAGS=-jN in your .mozconfig without risk of deadlocks.

Note: On Windows, if using an absolute path MOZ_OBJDIR in your .mozconfig, it must be a Windows-style (i.e. c:/foo/bar) rather than an MSYS-style (i.e. /c/foo/bar) path.

Revision Source

<p><code>make.py</code> (and the <code><a class="external" href="http://benjamin.smedbergs.us/pymake/" title="pymake">pymake</a></code> modules that support it) are an implementation of the <code>make</code> tool which are mostly compatible with makefiles written for GNU <code>make</code>.</p>
<h3 id="Prerequisites">Prerequisites</h3>
<p>If running Windows, you need to have <a href="/En/Developer_Guide/Build_Instructions/Windows_Prerequisites" title="Windows build prerequisites">a Windows build environment</a> installed for using <code>pymake</code> to build Mozilla.</p>
<p>On other operating systems (Linux, OS X, etc), <code>pymake</code> itself only requires Python 2.6 or higher (but not Python 3). Please note that Python 2.7 is strongly recommended.</p>
<h3 id="Usage">Usage</h3>
<div class="note">
  <p>If you use <a href="/en-US/docs/Developer_Guide/mach" title="/en-US/docs/Developer_Guide/mach">mach </a>for everything, you don't have to worry about gmake and pymake: mach will run whatever is best for the current machine.</p>
</div>
<div class="note">
  <p><strong>Note:</strong> On Windows, you must take special care to be able to switch back and forth between gmake and pymake on the same object dir. See <a href="/en-US/docs/Gmake_vs._Pymake" title="/en-US/docs/Gmake_vs._Pymake">Gmake vs. Pymake</a> for more information.</p>
</div>
<p>Anywhere you would normally type <code>make</code>, instead type <code>python /path/to/srcdir/build/pymake/make.py</code>.&nbsp; For example:</p>
<ul>
  <li>Instead of <code>make -f client.mk</code> to start a build, you would type <code>python build/pymake/make.py -f client.mk</code>.</li>
  <li>To run tests instead of typing <code>make mochitest-plain</code> in the object directory, you would type <code>python ../build/pymake/make.py mochitest-plain</code>.</li>
</ul>
<p>Alternately, if you would like to simply type in <code>pymake -f client.mk</code> from within the MINGW32 shell.</p>
<ul>
  <li>While in the shell type <code>cd ~</code> (without quotes).</li>
  <li>Type <code>touch .profile</code></li>
  <li>Using any appropriate text editor open .profile and add the following line in the file (assuming your mozilla-central is at <code>C:/mozilla-central</code>, if not, adjust your path accordingly.)</li>
</ul>
<p style="margin-left: 40px;"><code>alias pymake=C:/mozilla-central/build/pymake/make.py</code></p>
<ul>
  <li style="margin-left: ;">Save your .profile edit and close the shell, then restart the shell.</li>
  <li style="margin-left: ;">Try typing just <code>pymake</code> into the shell and press enter.&nbsp; This should come back with "No makefile found." If it does, your <code>pymake</code> alias is connected and you are ready to type in <code>pymake -f client.mk</code> to start the build.</li>
</ul>
<p>Unlike <code>gmake</code> on Windows, <code>pymake</code> is capable of doing parallel builds, so you can set a <code>MOZ_MAKE_FLAGS=-jN</code> in your .<code>mozconfig</code> without risk of deadlocks.</p>
<div class="note">
  <strong>Note:</strong> On Windows, if using an absolute path <code>MOZ_OBJDIR</code> in your <code>.mozconfig</code>, it must be a Windows-style (i.e. c:/foo/bar) rather than an MSYS-style (i.e. <code>/c/foo/bar</code>) path.</div>
Revert to this revision