My favorites | Sign in
Logo
             
Search
for
Updated Nov 09 (5 days ago) by rafa...@chromium.org
Labels: Linux
LinuxBuildInstructions  
Build instructions for Linux

This page describes how to build the Chromium code on Linux. Read this if you're interested in testing the build or porting code.


Before Starting

  • Prerequisites: what you need to build
  • Get the Code: checkout the source code
    • Do not get the code before you have installed the prerequisites, otherwise the gclient sync command may generate incorrect build files.
    • Be sure to follow the Get the Code instruction closely.
    • Important: ensure that you have GYP_GENERATORS=make in your environment before running gclient sync or gclient runhooks --force. This tells the Chromium build system to output Makefiles. Example:
    • export GYP_GENERATORS=make
      gclient sync
    • All make commands should be run from $CHROMIUM_ROOT/src directory.
    • Build output will be in the $CHROMIUM_ROOT/src/out directory.

Configuring

Compilation

Build in debug mode:

$ cd $CHROMIUM_ROOT/src
$ make

The above builds all libraries and tests in all components. Specifying other target names to restrict the build to just what you're interested in.

Example: to build just chrome:

$ cd $CHROMIUM_ROOT/src
$ make chrome

or to build just the simplest unit test:

$ cd $CHROMIUM_ROOT/src
$ make base_unittests

Or you can specify the explicit file you want to build:

$ cd $CHROMIUM_ROOT/src
$ make out/Debug/chrome

Executables

Executables are written in $CHROMIUM_ROOT/src/out/Debug for Debug builds, and $CHROMIUM_ROOT/src/out/Release for Release builds

Release mode

Add BUILDTYPE=Release to the make invocation:

$ cd $CHROMIUM_ROOT/src
$ make BUILDTYPE=Release

Seeing the actual commands

If you want to see the actual commands that make is invoking, add V=1 to the make invocation.

$ cd $CHROMIUM_ROOT/src
$ make V=1

This is useful if, for example, you are debugging gyp changes, or otherwise need to see what make is actually doing.

Troubleshooting

Advanced Features

Next Steps

If you want to contribute to the effort toward a Chromium-based browser for Linux, please check out the Linux Development page for more information.