Makefile - variables

  • Revision slug: How_Mozilla's_build_system_works/Makefile_-_variables
  • Revision title: Makefile - variables
  • Revision id: 38385
  • Created:
  • Creator: ashneo76
  • Is current revision? No
  • Comment one or more formatting changes

Revision Content

Note: Non-functional links can be fixed by inserting en/.
Variable name Description
ADD_TO_DEF_FILE  
CPP_SOURCES  
CPP_UNIT_TESTS A list of source files to compile as unit tests.
CSRCS A list of C source files to compile.
DEFINES Additional preprocessor defines for C++
EXPAND_MOZLIBNAME  
EXPORTS A list of exported header files and sources to install for external use.
EXPORTS_NAMESPACES Exported package include directory: dist/include/${namespace}
EXPORTS_${namespace} A list of exports/headers that should be copied into the exported namespace directory.
EXTRA_COMPONENTS nsDefaultCLH.manifest, JavaScript XPCOMM files
EXTRA_DSO_LIBS  
EXTRA_DSO_LDOPTS  
EXTRA_JS_MODULES  
EXTRA_PP_COMPONENTS XPCOMM files to pre-process before installation.
GARBAGE A "clean target" macro containing a list of files to remove.
GARBAGE_DIRS A "clean target" macro containing a list of directories to remove.
GLOBAL_DEPS A list of common dependencies (Makefile.in, autoconf.mk) that will force rebuilding.
LIBOBJS  
HAVE_DTRACE Sun Microsystem's dynamic tracing environment is available.
LOCAL_INCLUDES Allow use of MOZ_OBJDIR in .mozconfig with older GNU gcc on BeOS.
MODULE  
MODULE_NAME  
NO_DIST_INSTALL Inhibit generating and copying exports/install targets into $(MOZ_OBJDIR)/dist/install.
.NS_PRINTING  
OBJS  
OBJ_SUFFIX Filename suffix to use when writing object files.
MODULE Instructs the build system where to install exported headers.
SIMPLE_PROGRAMS  
SUPPRESS_DEFAULT_RULES Inhibit processing of Makefile TIER targets/directory processing will be unordered.
TIER Build order dependencies - subdirectories for make to traverse prior to building current.
XPIDL_MODULE Module name to use when generating .xpt files, default to MODULE.
XPIDLSRCS Internal: A list of .idl files to generate exported headers from.
configure.sh Variables Description
BUILD_PROJECT_ARG Command line/environment override
CONFIGURE_ENV_ARGS Command line/environment override
Directory Variable  
DIRS A list of subdirectories to build recursively.
PARALLEL_DIRS A list of subdirectories to build recursively that may be built concurrently.
STATIC_DIRS Subdirectories containing static makefiles that are not autogenerated.
TEST_DIRS A list of directories containing test makefiles
TOOL_DIRS A list of directories to process makefile 'tool' targets in.
MOZ_ Variable Description
MOZ_AUTO_DEPS  
MOZ_BUILD_APP  
MOZ_BUILD_PROJECTS Build multiple projects in the same sandbox.  Dest=$(MOZ_OBJDIR)/$project
MOZ_CURRENT_PROJECT  
MOZ_DEBUG  
MOZ_ENABLE_XREMOTE  
MOZ_FEEDS  
MOZ_HELP_VIEWER  
MOZ_NATIVE_NSPR  
MOZ_PKG_MAINFEST  
MOZ_PREFLIGHT_ALL  
MOZ_RDF  
MOZ_TOOLKIT_SEARCH  
MOZ_URL_CLASSIFIER  
MOZ_WIDGET_TOOLKIT  Android, BeOS, Cocoa, GTK2, OS2, Qt, Windows
MOZ_XPCTOOLS  
MOZ_XUL  
MOZ_X11  

Test Variable

Description
ENABLE_TESTS Boolean value that should wrapper all unit tests to allow disabling on demand[1].
XPC_SHELL_TESTS  
Compiler Variable Description
GNU_CC Defined if the GNU gcc compiler is available.
MODULE_OPTIMIZE_FLAGS Additional flags for enabling or overriding compiler optimizations(-O2).
SOLARIS_SUNPRO_CC Sun Studio compiler
Export Variables Description
AUTOCFG_JS_EXPORTS  
EXPORTS A list of exported headers and source files for external use.
HAS_EXTRA_EXPORTS  
PREF_JS_EXPORTS  JavaScript preferences file to export[1].
SDK_HEADERS  
NO_ Variable Description
NO_PROFILE_GUIDED_OPTIMIZE Inhibit PGO builds
NO_DIST_INSTALL  
Note: Values will be appended to the EXPORT variable when present.
OS_ Variable Description
OS_ARCH Platform type
OS_TARGET Target binary type if building on an intermediate platform(building mobile binaries on GNU/Linux).
HOST_ Variable Description
HOST_CMSRCS A list of .m sources to compile
HOST_CMMSRCS A list of .mm sources to compile
HOST_OBJS  
HOST_OS_ARCH ARCH of real platform a target platform is being built on(building mobile binaries on GNU/Linux).

Release Targets

Variable Description
DIST  Top level distribution directory for install/packaging/repacking.
DIST_FILES A list of files copied into the distribution archive(~application.ini).
DIST_CHROME_FILES Exists in rules.mk but not referenced by mozilla-central.  Deprecated?

l10n.mk and localization

Variable Description
EN_US_BINARY_URL Server URL from which wget will FTP binaries.
L10NBASEDIR  
PACKAGER_NO_LIBS Hack to allow one makefile to include another without pulling in libs:: target definitions.
STAGEDIST Local staging directory for localization and packaging.

 

Todo:

xpcom/xpinstall variables: https://developer.mozilla.org/en/Adding_XPCOM_components_to_Mozilla_build_system

Revision Source

<div class="note"><strong>Note:</strong> Non-functional links can be fixed by inserting <code>en/</code>.</div>
<table class="standard-table" style="width: 100%; height: 332px;"> <thead> <tr> <th>Variable name</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>ADD_TO_DEF_FILE</code></td> <td> </td> </tr> <tr> <td><code>CPP_SOURCES</code></td> <td> </td> </tr> <tr> <td><code>CPP_UNIT_TESTS</code></td> <td>A list of source files to compile as unit tests.</td> </tr> <tr> <td><code>CSRCS</code></td> <td>A list of C source files to compile.</td> </tr> <tr> <td>DEFINES</td> <td>Additional preprocessor defines for C++</td> </tr> <tr> <td><code>EXPAND_MOZLIBNAME</code></td> <td> </td> </tr> <tr> <td><code>EXPORTS</code></td> <td>A list of exported header files and sources to install for external use.</td> </tr> <tr> <td><code>EXPORTS_NAMESPACES</code></td> <td>Exported package include directory: <code>dist/include/${namespace}</code></td> </tr> <tr> <td><code>EXPORTS_${namespace}</code></td> <td>A list of exports/headers that should be copied into the exported namespace directory.</td> </tr> <tr> <td><code>EXTRA_COMPONENTS</code></td> <td><code>nsDefaultCLH.manifest, JavaScript XPCOMM files</code></td> </tr> <tr> <td><code>EXTRA_DSO_LIBS</code></td> <td> </td> </tr> <tr> <td><code>EXTRA_DSO_LDOPTS</code></td> <td> </td> </tr> <tr> <td><code>EXTRA_JS_MODULES</code></td> <td> </td> </tr> <tr> <td><code>EXTRA_PP_COMPONENTS</code></td> <td><code>XPCOMM files to pre-process before installation.</code></td> </tr> <tr> <td><code>GARBAGE</code></td> <td>A "clean target" macro containing a list of files to remove.</td> </tr> <tr> <td><code>GARBAGE_DIRS</code></td> <td>A "clean target" macro containing a list of directories to remove.</td> </tr> <tr> <td><a href="/en/GLOBAL_DEPS" title="en/GLOBAL DEPS"><code>GLOBAL_DEPS</code></a></td> <td>A list of common dependencies (<code>Makefile.in</code>, <code>autoconf.mk</code>) that will force rebuilding.</td> </tr> <tr> <td><code>LIBOBJS</code></td> <td> </td> </tr> <tr> <td><code>HAVE_DTRACE</code></td> <td>Sun Microsystem's dynamic tracing environment is available.</td> </tr> <tr> <td><code>LOCAL_INCLUDES</code></td> <td>Allow use of <code>MOZ_OBJDIR</code> in <code>.mozconfig</code> with older GNU gcc on BeOS.</td> </tr> <tr> <td><code>MODULE</code></td> <td> </td> </tr> <tr> <td><code>MODULE_NAME</code></td> <td> </td> </tr> <tr> <td><code>NO_DIST_INSTALL</code></td> <td>Inhibit generating and copying exports/install targets into <code>$(MOZ_OBJDIR)/dist/install</code>.</td> </tr> <tr> <td><code>.NS_PRINTING</code></td> <td> </td> </tr> <tr> <td><code>OBJS</code></td> <td> </td> </tr> <tr> <td><code>OBJ_SUFFIX</code></td> <td>Filename suffix to use when writing object files.</td> </tr> <tr> <td><code><a href="/en/MODULE" title="En/MODULE">MODULE</a></code></td> <td>Instructs the build system where to install exported headers.</td> </tr> <tr> <td><code>SIMPLE_PROGRAMS</code></td> <td> </td> </tr> <tr> <td><code>SUPPRESS_DEFAULT_RULES</code></td> <td>Inhibit processing of <code>Makefile</code> TIER targets/directory processing will be unordered.</td> </tr> <tr> <td><code><a href="/En/TIER" title="En/TIER">TIER</a></code></td> <td>Build order dependencies - subdirectories for make to traverse prior to building current.</td> </tr> <tr> <td><code>XPIDL_MODULE</code></td> <td>Module name to use when generating <code>.xpt</code> files, default to MODULE.</td> </tr> <tr> <td><code>XPIDLSRCS</code></td> <td><strong>Internal:</strong> A list of <code>.idl</code> files to generate exported headers from.</td> </tr> </tbody>
</table>
<table border="1" cellpadding="1" cellspacing="1" class="standard-table" style="width: 504px; height: 83px;"> <thead> <tr> <th scope="col">configure.sh Variables</th> <th scope="col">Description</th> </tr> </thead> <tbody> <tr> <td><code>BUILD_PROJECT_ARG</code></td> <td>Command line/environment override</td> </tr> <tr> <td><code>CONFIGURE_ENV_ARGS</code></td> <td>Command line/environment override</td> </tr> </tbody>
</table>
<table border="1" cellpadding="1" cellspacing="1" class="standard-table"> <thead> <tr> <th scope="col">Directory Variable</th> <th scope="col"> </th> </tr> </thead> <tbody> <tr> <td><code><a href="/en/DIRS" title="en/DIRS">DIRS</a></code></td> <td>A list of subdirectories to build recursively.</td> </tr> <tr> <td><code><a href="/En/PARALLEL_DIRS" title="En/PARALLEL DIRS">PARALLEL_DIRS</a></code></td> <td>A list of subdirectories to build recursively that may be built concurrently.</td> </tr> <tr> <td><code><a href="/en/STATIC_DIRS" title="en/STATIC DIRS">STATIC_DIRS</a></code></td> <td>Subdirectories containing static makefiles that are not autogenerated.</td> </tr> <tr> <td><code>TEST_DIRS</code></td> <td>A list of directories containing test makefiles</td> </tr> <tr> <td><code>TOOL_DIRS</code></td> <td>A list of directories to process makefile 'tool' targets in.</td> </tr> </tbody>
</table>
<table border="1" cellpadding="1" cellspacing="1" class="standard-table"> <thead> <tr> <th scope="col">MOZ_ Variable</th> <th scope="col">Description</th> </tr> </thead> <tbody> <tr> <td><code>MOZ_AUTO_DEPS</code></td> <td> </td> </tr> <tr> <td><code>MOZ_BUILD_APP</code></td> <td> </td> </tr> <tr> <td><code><a href="/en/Configuring_Build_Options" title="en/Configuring Build Options">MOZ_BUILD_PROJECTS</a></code></td> <td>Build multiple projects in the same sandbox.  <code>Dest=$(MOZ_OBJDIR)/$project</code></td> </tr> <tr> <td><code>MOZ_CURRENT_PROJECT</code></td> <td> </td> </tr> <tr> <td><code>MOZ_DEBUG</code></td> <td> </td> </tr> <tr> <td><code>MOZ_ENABLE_XREMOTE</code></td> <td> </td> </tr> <tr> <td><code>MOZ_FEEDS</code></td> <td> </td> </tr> <tr> <td><code>MOZ_HELP_VIEWER</code></td> <td> </td> </tr> <tr> <td><code>MOZ_NATIVE_NSPR</code></td> <td> </td> </tr> <tr> <td><code>MOZ_PKG_MAINFEST</code></td> <td> </td> </tr> <tr> <td><code>MOZ_PREFLIGHT_ALL</code></td> <td> </td> </tr> <tr> <td><code>MOZ_RDF</code></td> <td> </td> </tr> <tr> <td><code>MOZ_TOOLKIT_SEARCH</code></td> <td> </td> </tr> <tr> <td><code>MOZ_URL_CLASSIFIER</code></td> <td> </td> </tr> <tr> <td><code>MOZ_WIDGET_TOOLKIT</code></td> <td> Android, BeOS, Cocoa, GTK2, OS2, Qt, Windows</td> </tr> <tr> <td><code>MOZ_XPCTOOLS</code></td> <td> </td> </tr> <tr> <td><code>MOZ_XUL</code></td> <td> </td> </tr> <tr> <td><code>MOZ_X11</code></td> <td> </td> </tr> </tbody>
</table>
<table border="1" cellpadding="1" cellspacing="1" class="standard-table" style="width: 747px; height: 41px;"> <thead> <tr> <th scope="col"> <p>Test Variable</p> </th> <th scope="col">Description</th> </tr> </thead> <tbody> <tr> <td><code>ENABLE_TESTS</code></td> <td>Boolean value that should wrapper all unit tests to allow disabling on demand[<a href="/en/How_to_add_a_build-time_test" title="en/How to add a build-time test">1</a>].</td> </tr> <tr> <td><code>XPC_SHELL_TESTS</code></td> <td> </td> </tr> </tbody>
</table>
<table border="1" cellpadding="1" cellspacing="1" class="standard-table"> <thead> <tr> <th scope="col">Compiler Variable</th> <th scope="col">Description</th> </tr> </thead> <tbody> <tr> <td><code>GNU_CC</code></td> <td>Defined if the GNU gcc compiler is available.</td> </tr> <tr> <td><code>MODULE_OPTIMIZE_FLAGS</code></td> <td>Additional flags for enabling or overriding compiler optimizations(-O2).</td> </tr> <tr> <td><code>SOLARIS_SUNPRO_CC</code></td> <td>Sun Studio compiler</td> </tr> </tbody>
</table>
<table border="1" cellpadding="1" cellspacing="1" class="standard-table"> <thead> <tr> <th scope="col">Export Variables</th> <th scope="col">Description</th> </tr> </thead> <tbody> <tr> <td><code>AUTOCFG_JS_EXPORTS</code></td> <td> </td> </tr> <tr> <td><code><a href="/en/Installing_headers_using_EXPORTS" title="en/Installing headers using EXPORTS">EXPORTS</a></code></td> <td>A list of exported headers and source files for external use.</td> </tr> <tr> <td><code>HAS_EXTRA_EXPORTS</code></td> <td> </td> </tr> <tr> <td><code>PREF_JS_EXPORTS</code></td> <td> JavaScript preferences file to export[<a href="/User:xFallenAngel/Build_System" title="User:xFallenAngel/Build System">1</a>].</td> </tr> <tr> <td><code>SDK_HEADERS</code></td> <td> </td> </tr> </tbody>
</table>
<table border="1" cellpadding="1" cellspacing="1" class="standard-table"> <thead> <tr> <th scope="col">NO_ Variable</th> <th scope="col">Description</th> </tr> </thead> <tbody> <tr> <td><code>NO_PROFILE_GUIDED_OPTIMIZE</code></td> <td>Inhibit PGO builds</td> </tr> <tr> <td><code>NO_DIST_INSTALL</code></td> <td> </td> </tr> </tbody>
</table>
<div class="note"><strong>Note:</strong> Values will be appended to the <code>EXPORT</code> variable when present.</div>
<table border="1" cellpadding="1" cellspacing="1" class="standard-table"> <thead> <tr> <th scope="col">OS_ Variable</th> <th scope="col">Description</th> </tr> </thead> <tbody> <tr> <td><code>OS_ARCH</code></td> <td>Platform type</td> </tr> <tr> <td><code>OS_TARGET</code></td> <td>Target binary type if building on an intermediate platform(building mobile binaries on GNU/Linux).</td> </tr> </tbody>
</table>
<table border="1" cellpadding="1" cellspacing="1" class="standard-table"> <thead> <tr> <th scope="col">HOST_ Variable</th> <th scope="col">Description</th> </tr> </thead> <tbody> <tr> <td><code>HOST_CMSRCS</code></td> <td>A list of <code>.m</code> sources to compile</td> </tr> <tr> <td><code>HOST_CMMSRCS</code></td> <td>A list of <code>.mm</code> sources to compile</td> </tr> <tr> <td><code>HOST_OBJS</code></td> <td> </td> </tr> <tr> <td><code>HOST_OS_ARCH</code></td> <td><code>ARCH</code> of real platform a target platform is being built on(building mobile binaries on GNU/Linux).</td> </tr> </tbody>
</table>
<h2>Release Targets</h2>
<table border="1" cellpadding="1" cellspacing="1" class="standard-table"> <thead> <tr> <th scope="col">Variable</th> <th scope="col">Description</th> </tr> </thead> <tbody> <tr> <td><code>DIST</code></td> <td> Top level distribution directory for install/packaging/repacking.</td> </tr> <tr> <td><code>DIST_FILES</code></td> <td>A list of files copied into the distribution archive(<code>~application.ini</code>).</td> </tr> <tr> <td><code>DIST_CHROME_FILES</code></td> <td>Exists in <code>rules.mk</code> but not referenced by <code>mozilla-central</code>.  Deprecated?</td> </tr> </tbody>
</table>
<h2>l10n.mk and localization</h2>
<table border="1" cellpadding="1" cellspacing="1" class="standard-table" style="width: 860px; height: 72px;"> <thead> <tr> <th scope="col">Variable</th> <th scope="col">Description</th> </tr> </thead> <tbody> <tr> <td><code>EN_US_BINARY_URL</code></td> <td>Server URL from which <code>wget</code> will FTP binaries.</td> </tr> <tr> <td><code>L10NBASEDIR</code></td> <td> </td> </tr> <tr> <td><code>PACKAGER_NO_LIBS</code></td> <td>Hack to allow one <code>makefile</code> to include another without pulling in <code>libs::</code> target definitions.</td> </tr> <tr> <td><code>STAGEDIST</code></td> <td>Local staging directory for localization and packaging.</td> </tr> </tbody>
</table>
<p> </p>
<p>Todo:</p>
<p>xpcom/xpinstall variables: <a href="/en/Adding_XPCOM_components_to_Mozilla_build_system" title="https://developer.mozilla.org/en/Adding_XPCOM_components_to_Mozilla_build_system">https://developer.mozilla.org/en/Adding_XPCOM_components_to_Mozilla_build_system</a></p>
Revert to this revision