1 ReactOS Build System Documentation
2 ==================================
6 To generate GNU make makefiles and building ReactOS do the following:
8 1) Go to the top-level reactos directory
9 2) Run the command: mingw32-make
11 This will start building ReactOS.
13 To build a bootable CD run the following command:
17 This will create ReactOS.iso in the top-level reactos directory.
20 Top-level XML Build File
21 ------------------------
22 The top-level xml build file (ReactOS.xml) is processed by rbuild. The following is an example of how it could look like:
25 <!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
26 <project name="ReactOS" makefile="Makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude">
27 <xi:include href="config.xml">
29 <xi:include href="config.template.xml" />
33 <define name="_M_IX86" />
34 <if property="DBG" value="1">
35 <define name="DBG" value="1" />
36 <property name="DBG_OR_KDBG" value="true" />
39 <include base="ReactOS">include</include>
41 <directory name="boot">
42 <xi:include href="boot/boot.xml" />
45 <module name="bootcd" type="iso">
52 It is possible to split an xml build file over several files. The include element in the xi namespace is used to accomplish this.
55 <xi:include href="config.xml">
57 <xi:include href="config.template.xml" />
62 href - Name of xml build file to include. The filename is relative to the location of the current xml build file.
73 This element is used to provide the name of an alternate file that is to be included if the first include file did not exists.
87 There can be one project per top-level XML build file. A project can only be defined in a top-level xml build file.
90 <project name="ReactOS" makefile="Makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude">
95 name - Name of the project.
96 makefile - Filename of the GNU makefile that is to be created.
102 define, directory, if, include, module, property
107 There can be zero or more modules per xml build file.
110 <module name="msvcrt" type="win32dll" extension=".dll" entrypoint="_DllMain@12" baseaddress="0x70000000" mangledsymbols="true" installbase="system32" installname="msvcrt.dll" usewrc="false">
115 name - Name of the module. Also the base name of the generated file if such file is generated for the particular module type.
116 type - Type of module. See below for an explanation of module types.
117 extension - Extension of the generated file if such file is generated for the particular module type.
118 entrypoint - Entrypoint symbol of the generated file if such file is generated for the particular module type.
119 baseaddress - Base address of the generated file if such file is generated for the particular module type.
120 mangledsymbols - Controls wether or not to pass --kill-at to dlltool. If this attribute has the value false then --kill-at is passed to dlltool. If the value is true, then --kill-at is not passed to dlltool. If the generated file exports C++ classes then this need to be true.
121 installbase - Base directory of the generated file in the installation directory. This attribute is optional.
122 installname - Name of generated file in the installation directory. This attribute is optional, but if not specified, the generated file is not copied to the installation directory.
123 usewrc - Use WRC to compile resources if true. If false, windres is used. This attribute is optional. If not specified, WRC will be used.
129 bootstrap, component, define, dependency, directory, file, if, importlibrary, include, invoke, library, property.
134 The module type determines the actions that is to be carried out to process the module. The defined module types are seen below:
135 buildtool - Builds a tool that can be run (invoked) when building ReactOS. Default extension is .exe when building on Windows and nothing when building on Linux. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.
136 staticlibrary - Builds a static library containing object files that can be linked together with other modules. Default extension is .a. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.
137 objectlibrary - Builds object files that can be linked together with other modules. Default extension is .o. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.
138 kernel - Builds ntoskrnl.exe. Default extension is .exe. Default entrypoint is _NtProcessStartup.
139 kernelmodedll - Builds a kernel-mode DLL. Default extension is .dll. Default entrypoint is _DriverEntry@8.
140 kernelmodedriver - Builds a kernel-mode driver. Default extension is .sys. Default entrypoint is _DriverEntry@8.
141 nativedll - Builds a native DLL. Default extension is .dll. Default entrypoint is _DllMainCRTStartup@12.
142 win32dll - Builds a Win32 DLL. Default extension is .dll. Default entrypoint is _DllMain@12.
143 win32cui - Builds a Win32 console executable. Default extension is .exe. Default entrypoint is _mainCRTStartup. The baseaddress module attribute is not applicable for this module type.
144 win32gui - Builds a Win32 GUI executable. Default extension is .exe. Default entrypoint is _WinMainCRTStartup. The baseaddress module attribute is not applicable for this module type.
145 bootloader - Builds a bootloader. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.
146 bootsector - Builds one or more bootsector binaries. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.
147 iso - Builds a bootable CD. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.
148 test - Builds a testsuite. Default extension is .exe. Default entrypoint is _mainCRTStartup. The baseaddress module attribute is not applicable for this module type.
149 rpcserver - Generates and builds server code for an RPC interface. Default extension is .o. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.
150 rpcclient - Generates and builds client code for an RPC interface. Default extension is .o. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.
155 A bootstrap element specifies that the generated file should be put on the bootable CD as a bootstrap file.
158 <bootstrap base="reactos" nameoncd="halmp.dll" />
161 base - Put file in this directory on the bootable CD. This attribute is optional.
162 nameoncd - Name of file on the bootable CD. This attribute is optional.
173 A cdfile element specifies the name of a file that is to be put on the bootable CD.
176 <cdfile base="reactos" nameoncd="ReadMe.txt">ReadMe.txt</cdfile>
179 base - Put file in this directory on the bootable CD. This attribute is optional.
180 nameoncd - Name of file on the bootable CD. This attribute is optional.
191 A component element specifies that imports from a library are to be stubbed so tests can be run without actually calling the functions in the library. This element can only be used for modules of type test.
194 <component name="ntdll.dll">
199 name - Name of library.
210 A symbol element specifies an imported function from a library that is to be stubbed so tests can be run without actually calling the function in the library.
213 <symbol newname="RtlAllocateHeap">HeapAlloc@12</symbol>
216 newname - New name of symbol. This attribute is optional.
227 A define element specifies the name and (optionally) value of a define for the C/C++ compiler and resource compiler.
230 <define name="WINVER">0x501</define>
233 name - Name of define.
236 Value of define. The value is optional.
244 A dependency element specifies the name of a module (usually of type buildtool) that is to be processed before the current module.
247 <dependency>OtherModule</dependency>
261 A directory element specifies the name of a subdirectory.
264 <directory name="MyDirectory">
269 name - Name of directory.
275 cdfile, directory, file, if, property.
280 A file element specifies the name of a file that is to be processed.
283 <file>MyFile.c</file>
297 An if element allows for conditional processing of other elements.
300 <if property="DBG" value="1">
305 property - Name of the property that is to be evaluated.
306 value - Value to compare to the value of the property. If the property has the specified value, then the subelements are processed.
312 define, directory, file, if, include, property.
315 Importlibrary element
316 ---------------------
317 An importlibrary element specifies that an import library should be generated which other modules can use to link with the current module.
320 <importlibrary definition="MyModule.def" />
323 definition - Filename of definition file (.def) used to generate the import library. The filename is relative to the current module.
334 An include element specifies an include directory for the C/C++ compiler and resource compiler.
337 <include base="MyLibraryModule">include</include>
340 base - Module or project which the value of this element is relative to. This attribute is optional. If left out, the include directory is relative to the position of the top-level xml build file.
343 Relative include directory.
351 An installfile element specifies the name of a file that is to be installed when using 'make install'.
354 <installfile base="reactos" newname="ReadMe.txt">ReadMe.txt</installfile>
357 base - Put file in this directory within the install directory. This attribute is optional.
358 newname - Name of file within the install directory. This attribute is optional.
369 An invoke element specifies the name of a module which is to be executed before the current module is processed.
372 <invoke module="wmc">
374 <inputfile>ntoskrnl.mc</inputfile>
377 <outputfile switches="-H">../include/reactos/bugcodes.h</outputfile>
378 <outputfile switches="-o">bugcodes.rc</outputfile>
386 Name of the module to execute.
394 An input element specifies a group of filenames that is to be passed as parameters to a build tool. Input filename parameters are located after output filename parameters on the command line.
408 An inputfile element specifies a filename that is to be passed as a parameter to a build tool.
411 switches - Switches that is passed as parameters just before the filename. This attribute is optional.
414 Name of file that is to be passed as a parameter to the build tool.
422 An output element specifies a group of filenames that is to be passed as parameters to a build tool. Output filename parameters are located before input filename parameters on the command line.
436 An outputfile element specifies a filename that is to be passed as a parameter to a build tool.
439 switches - Switches that is passed as parameters just before the filename. This attribute is optional.
442 Name of file that is to be passed as a parameter to the build tool.
450 An importlibrary element specifies the name of another module which is to be linked with the current module.
453 <library>MyLibraryModule</library>
459 Name of the module to link with.
467 A property element specifies the name and value of a property that can be used for conditional processing of the xml build file.
470 <property name="mypropertyname" value="mypropertyvalue" />
473 name - Name of property.
474 value - Value of property.