pymake 编辑

pybuild is no longer supported! See bug 1027890.

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 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:122 次

字数:3278

最后编辑:6年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文