Difference between revisions of "Building ReactOS"

From ReactOS Wiki
Jump to: navigation, search
m (Protected "Building ReactOS" (‎[edit=sysop] (indefinite) ‎[move=sysop] (indefinite)))
(update this page)
Line 1: Line 1:
'''NOTE: This page is deprecated and is purely here for archival purposes. For instructions on building ReactOS, please see the [http://www.reactos.org/development/build-environment build environment] page of the development guide.'''
+
<!-- '''NOTE: This page is deprecated and is purely here for archival purposes. For instructions on building ReactOS, please see the [http://www.reactos.org/development/build-environment build environment] page of the development guide.''' -->
  
 
This page describes the steps necessary to build ReactOS.
 
This page describes the steps necessary to build ReactOS.
Line 5: Line 5:
 
== Getting all you need ==
 
== Getting all you need ==
  
 +
=== Setting up a Build Environment ===
 +
 +
For building ReactOS you also need the official [[ReactOS Build Environment]]. Please download and install it from that page.
 +
 +
Make sure that no interfering build environment (such as MSYS) is in your PATH environment variable when building.
 +
 +
<!-- {{Notice|Due to a current bug, the build environment can not use a build folder that contains spaces in its path name.<br />
 +
Under Windows XP and 2003 you  must change the default location of "C:\Documents and Settings\[username]\reactos\".}} -->
 
=== Getting a Working Copy ===
 
=== Getting a Working Copy ===
  
Line 12: Line 20:
 
To get a working copy of ReactOS, please read the [[Subversion]] page.
 
To get a working copy of ReactOS, please read the [[Subversion]] page.
  
If you do not use a separate SVN client, the command "ssvn create" from within the build environment will download it.  
+
If you do not use a separate SVN client, the command  
 
+
ssvn create
=== Setting up a Build Environment ===
+
from within the build environment will download it.  
 
 
For building ReactOS you also need the official [[ReactOS Build Environment]]. Please download and install it from that page.
 
 
 
Make sure that no interfering build environment (such as MSYS) is in your PATH environment variable when building.
 
 
 
{{Notice|Due to a current bug, the build environment can not use a build folder that contains spaces in its path name.<br />
 
Under Windows XP and 2003 you  must change the default location of "C:\Documents and Settings\[username]\reactos\".}}
 
  
 
== Prerequisites ==
 
== Prerequisites ==
  
You may want to temporarily disable your antivirus before proceeding.  
+
{{Notice|You should temporarily disable your antivirus before proceeding, because some of them detect ReactOS's as infected system files.}}
  
 
Before building either the tools or ReactOS itself the output location must be created and prepared. This is an easy step and involves only one command. This command is located in the root of recent revisions of the source code and can be run either from the root directory itself or any other directory you want the build your sources in. Please make sure you are running it from within ReactOS BE:
 
Before building either the tools or ReactOS itself the output location must be created and prepared. This is an easy step and involves only one command. This command is located in the root of recent revisions of the source code and can be run either from the root directory itself or any other directory you want the build your sources in. Please make sure you are running it from within ReactOS BE:
Line 35: Line 36:
 
  cd output-MinGW-i386
 
  cd output-MinGW-i386
 
</syntaxhighlight>
 
</syntaxhighlight>
=== Windows ===
+
 
 +
=== Windows or ReactOS ===
 
Run:
 
Run:
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
 
  configure.cmd
 
  configure.cmd
 +
cd output-MinGW-i386
 
</syntaxhighlight>
 
</syntaxhighlight>
 
After executing, folder <tt>output-MinGW-i386</tt> will be created in root of ReactOS tree. You will be redirected to it.
 
After executing, folder <tt>output-MinGW-i386</tt> will be created in root of ReactOS tree. You will be redirected to it.
Line 48: Line 51:
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
 
  cd host-tools
 
  cd host-tools
  make
+
  ninja all
 
</syntaxhighlight>
 
</syntaxhighlight>
With the build tools compiled, ReactOS can now be compiled. In the case of <tt>CMakeLists</tt> being updated it is best to remove the content of the <tt>build-ros</tt> folder and rebuild ReactOS.
+
With the build tools compiled, ReactOS can now be compiled.
 
 
 
 
=== Building ReactOS ===
 
  
 +
=== Building ReactOS on Windows or ReactOS* ===
 
Change to the "reactos" folder located inside output-MinGW-i386 (i.e. reactos\output-MinGW-i386\reactos):
 
Change to the "reactos" folder located inside output-MinGW-i386 (i.e. reactos\output-MinGW-i386\reactos):
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
 
  cd ..\reactos
 
  cd ..\reactos
  make COMMANDS
+
  ninja COMMANDS
 
</syntaxhighlight>
 
</syntaxhighlight>
Combining the above steps together:
+
 
<syntaxhighlight lang="dos">
+
Replace "COMMANDS" with the desired build commands, such as <code>bootcd</code> or <code>livecd</code>, listed below:
configure.cmd
+
 
cd output-MinGW-i386
+
<small>* Perhaps, some functions of RosBE may not work on ReactOS. If so, please have a look on our [http://jira.reactos.org/ Jira] page whether this problem is already reported or not.</small>
cd host-tools
 
make
 
cd ..\reactos
 
make COMMANDS
 
</syntaxhighlight>
 
Replace "COMMANDS" with the desired build commands, such as "bootcd" or "livecd", listed below:
 
  
 
=== Building ReactOS on Unix/Linux ===
 
=== Building ReactOS on Unix/Linux ===
 
 
Change to the "reactos" folder located inside output-MinGW-i386 (i.e. reactos/output-MinGW-i386/reactos):
 
Change to the "reactos" folder located inside output-MinGW-i386 (i.e. reactos/output-MinGW-i386/reactos):
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 79: Line 73:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Combining the above steps together:
 
Combining the above steps together:
<syntaxhighlight lang="bash">
+
Replace "COMMANDS" with the desired build commands, such as <code>bootcd</code> or <code>livecd</code>, listed below:
configure.sh
 
cd output-MinGW-i386/host-tools
 
ninja
 
cd ../reactos
 
ninja COMMANDS
 
</syntaxhighlight>
 
Replace "COMMANDS" with the desired build commands, such as "bootcd" or "livecd", listed below:
 
  
 
== Commands ==
 
== Commands ==
Line 94: Line 81:
 
=== Invoking a build ===
 
=== Invoking a build ===
  
'''make'''
+
<code>'''ninja'''</code> or <code>'''ninja all'''</code>
This command builds all binaries of ReactOS. They will be placed in the directory specified by the ROS_OUTPUT environment variable. (default: ''output-i386'')
+
 
 +
This command builds all binaries of ReactOS. They will be placed in the created output directory created by the configure command. (default: ''output-MinGW-i386/reactos'')
 
All source files, which did not change since the last build, will not be built again.
 
All source files, which did not change since the last build, will not be built again.
  
'''make bootcd'''
+
<code>'''ninja bootcd'''</code>
This command works like ''make'', but also generates a bootable ReactOS ISO file (''ReactOS.iso'') in the base of the working copy.
+
 
 +
This command works like ''make'', but also generates a bootable ReactOS ISO file (''bootcd.iso'') placed into the output directory.
 
It is wise to tag your Boot-CDs with the revision they were built from if you need to keep many ReactOS ISOs.
 
It is wise to tag your Boot-CDs with the revision they were built from if you need to keep many ReactOS ISOs.
  
'''make livecd'''
+
<code>'''ninja livecd'''</code>
This command generates ''ReactOS-LiveCD.iso'' in the base of the working copy. This is the ReactOS Live-CD that runs completely from the CD-ROM
 
 
 
'''make install'''
 
This command copies all the ReactOS binaries to their proper installation directory as specified in the ROS_INSTALL environment variable. (default: ''reactos'')
 
 
 
'''makex'''
 
Used instead of make will utilize all physical cores on your machine.
 
  
 +
This command generates ''livecd.iso'' in the output directory. This is the ReactOS Live-CD that runs completely from the CD-ROM.
 +
<!--
 
=== Other ===
 
=== Other ===
  
 
'''clean'''
 
'''clean'''
This command cleans all files of your working copy except the generated ISO files (if any). The next build you make will be completely clean then. Any parameters will recognized as module name and only this module will be cleaned then.
+
This command cleans all files of your working copy except the generated ISO files (if any). The next build you make will be completely clean then. Any parameters will recognized as module name and only this module will be cleaned then. -->
 
+
<!-- to be continued -->
'''remake'''
 
This tool cleans one or several specific modules and immediately rebuilds it cleanly.
 
 
 
'''make depmap'''
 
This command generates a simple dependency map for all ReactOS components.
 
 
 
'''make vreport'''
 
This command generates a version report for all ReactOS components, whose source files have appropriate information for that.
 
 
 
'''make world'''
 
This command is a shortcut for <code>make all bootcd livecd</code>
 
 
 
'''make universe'''
 
This command acts like <code>make world</code> but uses different debug settings and places the resulting files in separate directories.
 
This one is the one which creates the maximum of artefacts.
 
 
 
'''make rgenstat'''
 
 
 
'''make msbuild'''
 
 
 
'''make msbuild_clean'''
 
 
 
'''make depends'''
 
 
 
'''make makefile_auto_clean'''
 
  
 
== Adding modules to the build process ==
 
== Adding modules to the build process ==
Line 149: Line 108:
  
 
==See also ==
 
==See also ==
 +
* '''[http://www.reactos.org/development/build-environment Build Environment] - another tutorial how to build ReactOS '''
 
* [[Building with MSVC]]
 
* [[Building with MSVC]]
 
* [[Building MINGW-w64]]
 
* [[Building MINGW-w64]]
 
* [http://www.reactos.org/forum/viewtopic.php?f=22&t=11000 Building with Ninja] latest build method, RosBE v2.1
 
* [http://www.reactos.org/forum/viewtopic.php?f=22&t=11000 Building with Ninja] latest build method, RosBE v2.1
* [http://www.reactos.org/development/build-environment Build Environment], ninja commands
 
  
  
 
[[Category:Building]]
 
[[Category:Building]]
 
[[Category:Tutorial]]
 
[[Category:Tutorial]]

Revision as of 07:52, 9 November 2013


This page describes the steps necessary to build ReactOS.

Getting all you need

Setting up a Build Environment

For building ReactOS you also need the official ReactOS Build Environment. Please download and install it from that page.

Make sure that no interfering build environment (such as MSYS) is in your PATH environment variable when building.

Getting a Working Copy

The first step in building ReactOS is getting a copy of the source code.

You can use the exported release source code, but since you are reading this, you are probably interested in keeping up to date with the latest changes, so you will want a "working copy" of ReactOS. To get a working copy of ReactOS, please read the Subversion page.

If you do not use a separate SVN client, the command

ssvn create

from within the build environment will download it.

Prerequisites

Imbox notice.png

Notice: You should temporarily disable your antivirus before proceeding, because some of them detect ReactOS's as infected system files.

Before building either the tools or ReactOS itself the output location must be created and prepared. This is an easy step and involves only one command. This command is located in the root of recent revisions of the source code and can be run either from the root directory itself or any other directory you want the build your sources in. Please make sure you are running it from within ReactOS BE:

Linux/Unix

Run:

 configure.sh
 cd output-MinGW-i386

Windows or ReactOS

Run:

 configure.cmd
 cd output-MinGW-i386

After executing, folder output-MinGW-i386 will be created in root of ReactOS tree. You will be redirected to it.

Building Tools

To build the branch, build tools must be compiled first. This only needs to be done for the first build and whenever there is a change to the build tools.

From your output directory, go to host-tools. Follow specific instruction for your compiler.

 cd host-tools
 ninja all

With the build tools compiled, ReactOS can now be compiled.

Building ReactOS on Windows or ReactOS*

Change to the "reactos" folder located inside output-MinGW-i386 (i.e. reactos\output-MinGW-i386\reactos):

 cd ..\reactos
 ninja COMMANDS

Replace "COMMANDS" with the desired build commands, such as bootcd or livecd, listed below:

* Perhaps, some functions of RosBE may not work on ReactOS. If so, please have a look on our Jira page whether this problem is already reported or not.

Building ReactOS on Unix/Linux

Change to the "reactos" folder located inside output-MinGW-i386 (i.e. reactos/output-MinGW-i386/reactos):

 cd ../../output-MinGW-i386/reactos
 ninja COMMANDS

Combining the above steps together: Replace "COMMANDS" with the desired build commands, such as bootcd or livecd, listed below:

Commands

After you have started a Build Environment Command Prompt, there are certain commands available.

Invoking a build

ninja or ninja all

This command builds all binaries of ReactOS. They will be placed in the created output directory created by the configure command. (default: output-MinGW-i386/reactos) All source files, which did not change since the last build, will not be built again.

ninja bootcd

This command works like make, but also generates a bootable ReactOS ISO file (bootcd.iso) placed into the output directory. It is wise to tag your Boot-CDs with the revision they were built from if you need to keep many ReactOS ISOs.

ninja livecd

This command generates livecd.iso in the output directory. This is the ReactOS Live-CD that runs completely from the CD-ROM.

Adding modules to the build process

There are several modules you can add to the build process. For example rosapps contains some additional applications not included by default.

The page Building Modules describes, which modules exist and how to add them to the build process.

See also