cb53323f60695594ec7733c2dc60eb6c6330f4a7
[reactos.git] / reactos / tools / rbuild / doc / rbuild.dbk
1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
4 <book>
5 <title>ReactOS Build System Documentation</title>
6
7 <bookinfo>
8 <releaseinfo>$Id$</releaseinfo>
9
10 <author>
11 <firstname>Casper</firstname>
12
13 <surname>Hornstrup</surname>
14 </author>
15
16 <othercredit>
17 <firstname>Emanuele</firstname>
18
19 <surname>Aliberti</surname>
20 </othercredit>
21
22 <copyright>
23 <year>2005</year>
24 </copyright>
25 </bookinfo>
26
27 <chapter>
28 <title>Building ReactOS</title>
29
30 <section>
31 <title>Building ReactOS</title>
32
33 <para>To generate GNU make makefiles and building ReactOS, do the
34 following:<orderedlist>
35 <listitem>
36 <para>Go to the top-level <filename>reactos</filename>
37 directory;</para>
38 </listitem>
39
40 <listitem>
41 <para>Run the command:<screen>mingw32-make</screen></para>
42
43 <para>This will start building ReactOS.</para>
44 </listitem>
45 </orderedlist></para>
46
47 <para>To build a bootable CD, run the following command:<screen>mingw32-make bootcd</screen>This
48 will create <filename>ReactOS.iso</filename> in the top-level
49 <filename>reactos</filename> directory.</para>
50 </section>
51 </chapter>
52
53 <chapter>
54 <title>How build directions are stored</title>
55
56 <para>XML files are used throughout the ReactOS source tree to drive the
57 build system.</para>
58
59 <section>
60 <title>Top-level XML Build File</title>
61
62 <para>The top-level XML build file (<filename>ReactOS.xml</filename>) is
63 processed by <command>rbuild</command>. The following is an example of
64 how it could look like:<programlisting>&lt;?xml version="1.0"?&gt;
65 &lt;!DOCTYPE project SYSTEM "tools/rbuild/project.dtd"&gt;
66 &lt;project name="ReactOS" makefile="Makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude"&gt;
67 &lt;xi:include href="config.xml"&gt;
68 &lt;xi:fallback&gt;
69 &lt;xi:include href="config.template.xml" /&gt;
70 &lt;/xi:fallback&gt;
71 &lt;/xi:include&gt;
72
73 &lt;define name="_M_IX86" /&gt;
74 &lt;if property="DBG" value="1"&gt;
75 &lt;define name="DBG" value="1" /&gt;
76 &lt;property name="DBG_OR_KDBG" value="true" /&gt;
77 &lt;/if&gt;
78
79 &lt;include base="ReactOS"&gt;include&lt;/include&gt;
80
81 &lt;directory name="boot"&gt;
82 &lt;xi:include href="boot/boot.xml" /&gt;
83 &lt;/directory&gt;
84
85 &lt;module name="bootcd" type="iso"&gt;
86 &lt;/module&gt;
87 &lt;/project&gt;</programlisting></para>
88 </section>
89
90 <section>
91 <title>XInclude</title>
92
93 <para>XML files used by <command>rbuild</command> are modular and use
94 XInclude to include other chunks of XML in the top-level
95 <filename>ReactOS.xml</filename> file. The namespace used by XInclude is
96 <literal>xi</literal>.</para>
97
98 <section id="element.xi.include">
99 <title>xi:include</title>
100
101 <para>It is possible to split an XML build file over several files.
102 The include element in the <literal>xi</literal> namespace is used to
103 accomplish this.</para>
104
105 <section>
106 <title>Syntax</title>
107
108 <programlisting>&lt;xi:include href="<replaceable>config.xml</replaceable>"&gt;
109 &lt;xi:fallback&gt;
110 &lt;xi:include href="<replaceable>config.template.xml</replaceable>" /&gt;
111 &lt;/xi:fallback&gt;
112 &lt;/xi:include&gt;</programlisting>
113 </section>
114
115 <section>
116 <title>Attributes</title>
117
118 <para><variablelist>
119 <varlistentry>
120 <term>href</term>
121
122 <listitem>
123 <para>Name of XML build file to include. The filename is
124 relative to the location of the current XML build
125 file.</para>
126 </listitem>
127 </varlistentry>
128 </variablelist></para>
129 </section>
130
131 <section>
132 <title>Content</title>
133
134 <para>None.</para>
135 </section>
136
137 <section>
138 <title>Children</title>
139
140 <para><link linkend="element.xi.fallback">xi:fallback</link>.</para>
141 </section>
142 </section>
143
144 <section id="element.xi.fallback">
145 <title>xi:fallback</title>
146
147 <para>This element is used to provide the name of an alternate file
148 that is to be included if the first include file did not
149 exists.</para>
150
151 <section>
152 <title>Syntax</title>
153
154 <programlisting>&lt;xi:fallback&gt;
155 &lt;xi:include href="<replaceable>config.template.xml</replaceable>" /&gt;
156 &lt;/xi:fallback&gt;</programlisting>
157 </section>
158
159 <section>
160 <title>Attributes</title>
161
162 <para>None.</para>
163 </section>
164
165 <section>
166 <title>Content</title>
167
168 <para>None.</para>
169 </section>
170
171 <section>
172 <title>Parents</title>
173
174 <para><link linkend="element.xi.include">xi:include</link>.</para>
175 </section>
176
177 <section>
178 <title>Children</title>
179
180 <para><link linkend="element.xi.include">xi:include</link>.</para>
181 </section>
182 </section>
183 </section>
184
185 <section>
186 <title>Element reference</title>
187
188 <section id="element.bootstrap">
189 <title>Bootstrap element</title>
190
191 <para>A bootstrap element specifies that the generated file should be
192 put on the bootable CD as a bootstrap file.</para>
193
194 <section>
195 <title>Syntax</title>
196
197 <para><programlisting>&lt;bootstrap base="reactos" nameoncd="halmp.dll" /&gt;</programlisting></para>
198 </section>
199
200 <section>
201 <title>Attributes</title>
202
203 <para><variablelist>
204 <varlistentry>
205 <term>base</term>
206
207 <listitem>
208 <para>Put file in this directory on the bootable CD. This
209 attribute is optional.</para>
210 </listitem>
211 </varlistentry>
212
213 <varlistentry>
214 <term>nameoncd</term>
215
216 <listitem>
217 <para>Name of file on the bootable CD. This attribute is
218 optional.</para>
219 </listitem>
220 </varlistentry>
221 </variablelist></para>
222 </section>
223
224 <section>
225 <title>Content</title>
226
227 <para>None.</para>
228 </section>
229
230 <section>
231 <title>Parents</title>
232
233 <para><link linkend="element.module">module</link>.</para>
234 </section>
235
236 <section>
237 <title>Children</title>
238
239 <para>None.</para>
240 </section>
241 </section>
242
243 <section id="element.cdfile">
244 <title>CDFile element</title>
245
246 <para>A cdfile element specifies the name of a file that is to be put
247 on the bootable CD.</para>
248
249 <section>
250 <title>Syntax</title>
251
252 <para><programlisting>&lt;cdfile base="reactos" nameoncd="ReadMe.txt"&gt;ReadMe.txt&lt;/cdfile&gt;</programlisting></para>
253 </section>
254
255 <section>
256 <title>Attributes</title>
257
258 <para><variablelist>
259 <varlistentry>
260 <term>base</term>
261
262 <listitem>
263 <para>Put file in this directory on the bootable CD. This
264 attribute is optional.</para>
265 </listitem>
266 </varlistentry>
267
268 <varlistentry>
269 <term>nameoncd</term>
270
271 <listitem>
272 <para>Name of file on the bootable CD. This attribute is
273 optional.</para>
274 </listitem>
275 </varlistentry>
276 </variablelist></para>
277 </section>
278
279 <section>
280 <title>Content</title>
281
282 <para>Name of file.</para>
283 </section>
284
285 <section>
286 <title>Children</title>
287
288 <para>None.</para>
289 </section>
290 </section>
291
292 <section id="element.compilerflag">
293 <title>Compilerflag element</title>
294
295 <para>A compilerflag element specifies additional flags to be bassed
296 to the compiler.</para>
297
298 <section>
299 <title>Syntax</title>
300
301 <para><programlisting>&lt;compilerflags&gt;<replaceable>-Wpointer-arith</replaceable>&lt;/compilerflag&gt;</programlisting></para>
302 </section>
303
304 <section>
305 <title>Attributes.</title>
306
307 <para>None.</para>
308 </section>
309
310 <section>
311 <title>Content</title>
312
313 <para>The compiler flags.</para>
314 </section>
315
316 <section>
317 <title>Parents</title>
318
319 <para><link linkend="element.if">if</link>, <link
320 linkend="element.project">project</link>.</para>
321 </section>
322
323 <section>
324 <title>Children</title>
325
326 <para>None.</para>
327 </section>
328 </section>
329
330 <section id="element.component">
331 <title>Component element</title>
332
333 <para>A component element specifies that imports from a library are to
334 be stubbed so tests can be run without actually calling the functions
335 in the library. This element can only be used for modules of type
336 test.</para>
337
338 <section>
339 <title>Syntax</title>
340
341 <para><programlisting>&lt;component name="ntdll.dll"&gt;
342 ...
343 &lt;/component&gt;</programlisting></para>
344 </section>
345
346 <section>
347 <title>Attributes</title>
348
349 <para><variablelist>
350 <varlistentry>
351 <term>name</term>
352
353 <listitem>
354 <para>Name of library.</para>
355 </listitem>
356 </varlistentry>
357 </variablelist></para>
358 </section>
359
360 <section>
361 <title>Content</title>
362
363 <para>None.</para>
364 </section>
365
366 <section>
367 <title>Children</title>
368
369 <para><link linkend="element.symbol">symbol</link>.</para>
370 </section>
371 </section>
372
373 <section id="element.define">
374 <title>Define element</title>
375
376 <para>A define element specifies the name and (optionally) value of a
377 define for the C/C++ compiler and resource compiler.</para>
378
379 <section>
380 <title>Syntax</title>
381
382 <para><programlisting>&lt;define name="<replaceable>WINVER</replaceable>"&gt;<replaceable>0x501</replaceable>&lt;/define&gt;</programlisting></para>
383 </section>
384
385 <section>
386 <title>Attributes</title>
387
388 <para><variablelist>
389 <varlistentry>
390 <term>name</term>
391
392 <listitem>
393 <para>Name of define.</para>
394 </listitem>
395 </varlistentry>
396 </variablelist></para>
397 </section>
398
399 <section>
400 <title>Content</title>
401
402 <para>Value of define. The value is optional.</para>
403 </section>
404
405 <section>
406 <title>Parents</title>
407
408 <para><link linkend="element.project">project</link>, <link
409 linkend="element.module">module</link>.</para>
410 </section>
411
412 <section>
413 <title>Children</title>
414
415 <para>None.</para>
416 </section>
417 </section>
418
419 <section id="element.dependency">
420 <title>Dependency element</title>
421
422 <para>A dependency element specifies the name of a module (usually of
423 type buildtool) that is to be processed before the current
424 module.</para>
425
426 <section>
427 <title>Syntax</title>
428
429 <para><programlisting>&lt;dependency&gt;<replaceable>OtherModule</replaceable>&lt;/dependency&gt;</programlisting></para>
430 </section>
431
432 <section>
433 <title>Attributes</title>
434
435 <para>None.</para>
436 </section>
437
438 <section>
439 <title>Content</title>
440
441 <para>Name of module.</para>
442 </section>
443
444 <section>
445 <title>Children</title>
446
447 <para>None.</para>
448 </section>
449 </section>
450
451 <section id="element.directory">
452 <title>Directory element</title>
453
454 <para>A directory element specifies the name of a subdirectory.</para>
455
456 <section>
457 <title>Syntax</title>
458
459 <para><programlisting>&lt;directory name="<replaceable>MyDirectory</replaceable>"&gt;
460 ...
461 &lt;/directory&gt;</programlisting></para>
462 </section>
463
464 <section>
465 <title>Attributes</title>
466
467 <para><variablelist>
468 <varlistentry>
469 <term>name</term>
470
471 <listitem>
472 <para>Name of directory.</para>
473 </listitem>
474 </varlistentry>
475 </variablelist></para>
476 </section>
477
478 <section>
479 <title>Content</title>
480
481 <para>None.</para>
482 </section>
483
484 <section>
485 <title>Parents</title>
486
487 <para><link linkend="element.directory">directory</link>, <link
488 linkend="element.directory">if</link>, <link
489 linkend="element.project">project</link>.</para>
490 </section>
491
492 <section>
493 <title>Children</title>
494
495 <para><link linkend="element.cdfile">cdfile</link>, <link
496 linkend="element.directory">directory</link>, <link
497 linkend="element.file">file</link>, <link
498 linkend="element.if">if</link>, <link
499 linkend="element.pch">pch</link>, <link
500 linkend="element.property">property</link>.</para>
501 </section>
502 </section>
503
504 <section id="element.file">
505 <title>File element</title>
506
507 <para>A file element specifies the name of a file that is to be
508 processed.</para>
509
510 <section>
511 <title>Syntax</title>
512
513 <para><programlisting>&lt;file&gt;<replaceable>MyFile.c</replaceable>&lt;/file&gt;</programlisting></para>
514 </section>
515
516 <section>
517 <title>Attributes</title>
518
519 <para>None.</para>
520 </section>
521
522 <section>
523 <title>Content</title>
524
525 <para>Name of file.</para>
526 </section>
527
528 <section>
529 <title>Parents</title>
530
531 <para><link linkend="element.directory">directory</link>, <link
532 linkend="element.module">module</link>.</para>
533 </section>
534
535 <section>
536 <title>Children</title>
537
538 <para>None.</para>
539 </section>
540 </section>
541
542 <section id="element.group">
543 <title>Group element</title>
544
545 <para>A group element's purpose is grouping subelements.</para>
546
547 <section>
548 <title>Syntax</title>
549
550 <para><programlisting>&lt;group&gt;
551 &lt;file&gt;<replaceable>i386-dis.c</replaceable>&lt;/file&gt;
552 &lt;file&gt;<replaceable>kdb_help.S</replaceable>&lt;/file&gt;
553 &lt;file&gt;<replaceable>longjmp.S</replaceable>&lt;/file&gt;
554 &lt;file&gt;<replaceable>setjmp.S</replaceable>&lt;/file&gt;
555 &lt;/group&gt;</programlisting></para>
556 </section>
557
558 <section>
559 <title>Attributes</title>
560
561 <para>None.</para>
562 </section>
563
564 <section>
565 <title>Content</title>
566
567 <para>None.</para>
568 </section>
569
570 <section>
571 <title>Parents</title>
572
573 <para><link linkend="element.if">if</link>.</para>
574 </section>
575
576 <section>
577 <title>Children</title>
578
579 <para><link linkend="element.file">file</link>.</para>
580 </section>
581 </section>
582
583 <section id="element.if">
584 <title>If element</title>
585
586 <para>An if element allows for conditional processing of other
587 elements.</para>
588
589 <section>
590 <title>Syntax</title>
591
592 <para><programlisting>&lt;if property="<replaceable>DBG</replaceable>" value="<replaceable>1</replaceable>"&gt;
593 ...
594 &lt;/if&gt;</programlisting></para>
595 </section>
596
597 <section>
598 <title>Attributes</title>
599
600 <para><variablelist>
601 <varlistentry>
602 <term>property</term>
603
604 <listitem>
605 <para>Name of the property that is to be evaluated.</para>
606 </listitem>
607 </varlistentry>
608
609 <varlistentry>
610 <term>value</term>
611
612 <listitem>
613 <para>Value to compare to the value of the property. If the
614 property has the specified value, then the subelements are
615 processed.</para>
616 </listitem>
617 </varlistentry>
618 </variablelist></para>
619 </section>
620
621 <section>
622 <title>Content</title>
623
624 <para>None.</para>
625 </section>
626
627 <section>
628 <title>Parents</title>
629
630 <para><link linkend="element.project">project</link>, <link
631 linkend="element.directory">directory</link>.</para>
632 </section>
633
634 <section>
635 <title>Children</title>
636
637 <para><link linkend="element.compilerflag">compilerflag</link>,
638 <link linkend="element.define">define</link>, <link
639 linkend="element.directory">directory</link>, <link
640 linkend="element.file">file</link>, <link
641 linkend="element.if">if</link>, <link
642 linkend="element.include">include</link>, <link
643 linkend="element.property">property</link>.</para>
644 </section>
645 </section>
646
647 <section id="element.importlibrary">
648 <title>Importlibrary element</title>
649
650 <para>An importlibrary element specifies that an import library should
651 be generated which other modules can use to link with the current
652 module.</para>
653
654 <section>
655 <title>Syntax</title>
656
657 <para><programlisting>&lt;importlibrary definition="<replaceable>MyModule.def</replaceable>" /&gt;</programlisting></para>
658 </section>
659
660 <section>
661 <title>Attributes</title>
662
663 <para><variablelist>
664 <varlistentry>
665 <term>definition</term>
666
667 <listitem>
668 <para>Filename of definition file
669 (<filename>.def</filename>) used to generate the import
670 library. The filename is relative to the current
671 module.</para>
672 </listitem>
673 </varlistentry>
674 </variablelist></para>
675 </section>
676
677 <section>
678 <title>Content</title>
679
680 <para>None.</para>
681 </section>
682
683 <section>
684 <title>Parents</title>
685
686 <para><link linkend="element.module">module</link>.</para>
687 </section>
688
689 <section>
690 <title>Children</title>
691
692 <para>None.</para>
693 </section>
694 </section>
695
696 <section id="element.include">
697 <title>Include element</title>
698
699 <para>An include element specifies an include directory for the C/C++
700 compiler and resource compiler.</para>
701
702 <section>
703 <title>Syntax</title>
704
705 <para><programlisting>&lt;include base="<replaceable>MyLibraryModule</replaceable>"&gt;<replaceable>include</replaceable>&lt;/include&gt;</programlisting></para>
706 </section>
707
708 <section>
709 <title>Attributes</title>
710
711 <para><variablelist>
712 <varlistentry>
713 <term>base</term>
714
715 <listitem>
716 <para>Module or project which the value of this element is
717 relative to. This attribute is optional. If left out, the
718 include directory is relative to the position of the
719 top-level XML build file.</para>
720 </listitem>
721 </varlistentry>
722 </variablelist></para>
723 </section>
724
725 <section>
726 <title>Content</title>
727
728 <para>Relative include directory.</para>
729 </section>
730
731 <section>
732 <title>Parents</title>
733
734 <para><link linkend="element.project">project</link>, <link
735 linkend="element.module">module</link>.</para>
736 </section>
737
738 <section>
739 <title>Children</title>
740
741 <para>None.</para>
742 </section>
743 </section>
744
745 <section id="element.input">
746 <title>Input element</title>
747
748 <para>An input element specifies a group of filenames that is to be
749 passed as parameters to a build tool. Input filename parameters are
750 located after output filename parameters on the command line.</para>
751
752 <section>
753 <title>Syntax</title>
754
755 <para><programlisting>&lt;input&gt;
756 ...
757 &lt;/input&gt;</programlisting></para>
758 </section>
759
760 <section>
761 <title>Attributes</title>
762
763 <para>None.</para>
764 </section>
765
766 <section>
767 <title>Content</title>
768
769 <para>None.</para>
770 </section>
771
772 <section>
773 <title>Parents</title>
774
775 <para><link linkend="element.invoke">invoke</link>.</para>
776 </section>
777
778 <section>
779 <title>Children</title>
780
781 <para><link linkend="element.inputfile">inputfile</link>.</para>
782 </section>
783 </section>
784
785 <section id="element.inputfile">
786 <title>Inputfile element</title>
787
788 <para>An inputfile element specifies a filename that is to be passed
789 as a parameter to a build tool.</para>
790
791 <section>
792 <title>Syntax</title>
793
794 <para><programlisting>&lt;inputfile&gt;<replaceable>ntoskrnl.mc</replaceable>&lt;/inputfile&gt;</programlisting></para>
795 </section>
796
797 <section>
798 <title>Attributes</title>
799
800 <para><variablelist>
801 <varlistentry>
802 <term>switches</term>
803
804 <listitem>
805 <para>Switches that is passed as parameters just before the
806 filename. This attribute is optional.</para>
807 </listitem>
808 </varlistentry>
809 </variablelist></para>
810 </section>
811
812 <section>
813 <title>Content</title>
814
815 <para>Name of file that is to be passed as a parameter to the build
816 tool.</para>
817 </section>
818
819 <section>
820 <title>Parents</title>
821
822 <para><link linkend="element.input">input</link>.</para>
823 </section>
824
825 <section>
826 <title>Children</title>
827
828 <para>None.</para>
829 </section>
830 </section>
831
832 <section id="element.installfile">
833 <title>Installfile element</title>
834
835 <para>An installfile element specifies the name of a file that is to
836 be installed when using '<command>make install</command>'.</para>
837
838 <section>
839 <title>Syntax</title>
840
841 <para><programlisting>&lt;installfile base="<replaceable>reactos</replaceable>" newname="<replaceable>ReadMe.txt</replaceable>"&gt;<replaceable>ReadMe.txt</replaceable>&lt;/installfile&gt;</programlisting></para>
842 </section>
843
844 <section>
845 <title>Attributes</title>
846
847 <para><variablelist>
848 <varlistentry>
849 <term>base</term>
850
851 <listitem>
852 <para>Put file in this directory within the install
853 directory. This attribute is optional.</para>
854 </listitem>
855 </varlistentry>
856
857 <varlistentry>
858 <term>newname</term>
859
860 <listitem>
861 <para>Name of file within the install directory. This
862 attribute is optional.</para>
863 </listitem>
864 </varlistentry>
865 </variablelist></para>
866 </section>
867
868 <section>
869 <title>Content</title>
870
871 <para>Name of file.</para>
872 </section>
873
874 <section>
875 <title>Children</title>
876
877 <para>None.</para>
878 </section>
879 </section>
880
881 <section id="element.invoke">
882 <title>Invoke element</title>
883
884 <para>An invoke element specifies the name of a module which is to be
885 executed before the current module is processed.</para>
886
887 <section>
888 <title>Syntax</title>
889
890 <para><programlisting>&lt;invoke module="<replaceable>wmc</replaceable>"&gt;
891 &lt;input&gt;
892 &lt;inputfile&gt;<replaceable>ntoskrnl.mc</replaceable>&lt;/inputfile&gt;
893 &lt;/input&gt;
894 &lt;output&gt;
895 &lt;outputfile switches="<replaceable>-H</replaceable>"&gt;<replaceable>../include/reactos/bugcodes.h</replaceable>&lt;/outputfile&gt;
896 &lt;outputfile switches="<replaceable>-o</replaceable>"&gt;<replaceable>bugcodes.rc</replaceable>&lt;/outputfile&gt;
897 &lt;/output&gt;
898 &lt;/invoke&gt;</programlisting></para>
899 </section>
900
901 <section>
902 <title>Attributes</title>
903
904 <para><variablelist>
905 <varlistentry>
906 <term>module</term>
907
908 <listitem>
909 <para>Name of the module to execute.</para>
910 </listitem>
911 </varlistentry>
912 </variablelist></para>
913 </section>
914
915 <section>
916 <title>Content</title>
917
918 <para>None.</para>
919 </section>
920
921 <section>
922 <title>Children</title>
923
924 <para><link linkend="element.input">input</link>, <link
925 linkend="element.output">output</link>.</para>
926 </section>
927 </section>
928
929 <section id="element.library">
930 <title>Library element</title>
931
932 <para>A library element specifies the name of another module which is
933 to be linked with the current module.</para>
934
935 <section>
936 <title>Syntax</title>
937
938 <para><programlisting>&lt;library&gt;<replaceable>MyLibraryModule</replaceable>&lt;/library&gt;</programlisting></para>
939 </section>
940
941 <section>
942 <title>Attributes</title>
943
944 <para>None.section</para>
945 </section>
946
947 <section>
948 <title>Parents</title>
949
950 <para><link linkend="element.module">module</link>.</para>
951 </section>
952
953 <section>
954 <title>Children</title>
955
956 <para>None.</para>
957 </section>
958 </section>
959
960 <section id="element.linkerflag">
961 <title>Linkerflag element</title>
962
963 <para>A likerflag element specifies flags to be passed to the linker
964 tool.</para>
965
966 <section>
967 <title>Syntax</title>
968
969 <para><programlisting>&lt;linkerflag&gt;<replaceable>-lgcc</replaceable>&lt;/linkerflag&gt;</programlisting></para>
970 </section>
971
972 <section>
973 <title>Attributes</title>
974
975 <para>None.</para>
976 </section>
977
978 <section>
979 <title>Content</title>
980
981 <para>The switches to pass to the linker.</para>
982 </section>
983
984 <section>
985 <title>Parents</title>
986
987 <para><link linkend="element.module">module</link>.</para>
988 </section>
989
990 <section>
991 <title>Children</title>
992
993 <para>None.</para>
994 </section>
995 </section>
996
997 <section id="element.module">
998 <title>Module element</title>
999
1000 <para>There can be zero or more <sgmltag
1001 class="element">module</sgmltag>s per XML build file.</para>
1002
1003 <section>
1004 <title>Syntax</title>
1005
1006 <para><programlisting>&lt;module if="${MP}" ifnot="${MP}" name="msvcrt" type="win32dll" extension=".dll" entrypoint="_DllMain@12" baseaddress="0x70000000" mangledsymbols="true" installbase="system32" installname="msvcrt.dll" usewrc="false" warnings="true" aliasof="module1"&gt;
1007 ...
1008 &lt;/module&gt;</programlisting></para>
1009 </section>
1010
1011 <section>
1012 <title>Attributes</title>
1013
1014 <para><variablelist>
1015 <varlistentry>
1016 <term>if</term>
1017
1018 <listitem>
1019 <para>If the value is 1, then the module is enabled,
1020 otherwise it is disabled. A disabled module is not
1021 processed.</para>
1022 </listitem>
1023 </varlistentry>
1024
1025 <varlistentry>
1026 <term>ifnot</term>
1027
1028 <listitem>
1029 <para>If the value is 1, then the module is disabled,
1030 otherwise it is enabled. A disabled module is not
1031 processed.</para>
1032 </listitem>
1033 </varlistentry>
1034
1035 <varlistentry>
1036 <term>name</term>
1037
1038 <listitem>
1039 <para>Name of the module. Also the base name of the
1040 generated file if such file is generated for the particular
1041 module type.</para>
1042 </listitem>
1043 </varlistentry>
1044
1045 <varlistentry>
1046 <term>type</term>
1047
1048 <listitem>
1049 <para>Type of module. See below for an explanation of module
1050 types. <emphasis><emphasis>The module type determines the
1051 actions that is to be carried out to process the module. The
1052 defined module types are seen
1053 below:</emphasis></emphasis></para>
1054
1055 <table>
1056 <title>Module Types</title>
1057
1058 <tgroup cols="6">
1059 <thead>
1060 <row>
1061 <entry>Value</entry>
1062
1063 <entry>Output name suffix</entry>
1064
1065 <entry>Entrypoint</entry>
1066
1067 <entry>Baseaddress</entry>
1068
1069 <entry>Mangledsymbols</entry>
1070
1071 <entry>Description</entry>
1072 </row>
1073 </thead>
1074
1075 <tbody>
1076 <row>
1077 <entry>buildtool</entry>
1078
1079 <entrytbl cols="2">
1080 <tbody>
1081 <row>
1082 <entry><filename>.exe</filename> (Windows)</entry>
1083
1084 <entry>none (Linux)</entry>
1085 </row>
1086 </tbody>
1087 </entrytbl>
1088
1089 <entry>-</entry>
1090
1091 <entry>-</entry>
1092
1093 <entry>-</entry>
1094
1095 <entry>Builds a tool that can be run (invoked) when
1096 building ReactOS.</entry>
1097 </row>
1098
1099 <row>
1100 <entry>staticlibrary</entry>
1101
1102 <entry><filename>.a</filename></entry>
1103
1104 <entry>-</entry>
1105
1106 <entry>-</entry>
1107
1108 <entry>-</entry>
1109
1110 <entry>Builds a static library containing object
1111 files that can be linked together with other
1112 modules.</entry>
1113 </row>
1114
1115 <row>
1116 <entry>objectlibrary</entry>
1117
1118 <entry><filename>.o</filename></entry>
1119
1120 <entry>-</entry>
1121
1122 <entry>-</entry>
1123
1124 <entry>-</entry>
1125
1126 <entry>Builds object files that can be linked
1127 together with other modules.</entry>
1128 </row>
1129
1130 <row>
1131 <entry>kernel</entry>
1132
1133 <entry><filename>.exe</filename></entry>
1134
1135 <entry><function>_NtProcessStartup</function></entry>
1136
1137 <entry>-</entry>
1138
1139 <entry>-</entry>
1140
1141 <entry>Builds
1142 <filename>ntoskrnl.exe</filename>.</entry>
1143 </row>
1144
1145 <row>
1146 <entry>kernelmodedll</entry>
1147
1148 <entry><filename>.dll</filename></entry>
1149
1150 <entry><function>_DriverEntry@8</function></entry>
1151
1152 <entry>-</entry>
1153
1154 <entry>-</entry>
1155
1156 <entry>Builds a kernel-mode DLL.</entry>
1157 </row>
1158
1159 <row>
1160 <entry>kernelmodedriver</entry>
1161
1162 <entry><filename>.sys</filename></entry>
1163
1164 <entry><function>_DriverEntry@8</function></entry>
1165
1166 <entry>-</entry>
1167
1168 <entry>-</entry>
1169
1170 <entry>Builds a kernel-mode driver.</entry>
1171 </row>
1172
1173 <row>
1174 <entry>nativedll</entry>
1175
1176 <entry><filename>.dll</filename></entry>
1177
1178 <entry><function>_DllMainCRTStartup@12</function></entry>
1179
1180 <entry>-</entry>
1181
1182 <entry>-</entry>
1183
1184 <entry>Builds a native DLL.</entry>
1185 </row>
1186
1187 <row>
1188 <entry>win32dll</entry>
1189
1190 <entry><filename>.dll</filename></entry>
1191
1192 <entry><function>_DllMain@12</function></entry>
1193
1194 <entry>-</entry>
1195
1196 <entry>-</entry>
1197
1198 <entry>Builds a Win32 DLL.</entry>
1199 </row>
1200
1201 <row>
1202 <entry>win32cui</entry>
1203
1204 <entry><filename>.exe</filename></entry>
1205
1206 <entry><function>_mainCRTStartup</function></entry>
1207
1208 <entry>-</entry>
1209
1210 <entry>-</entry>
1211
1212 <entry>Builds a Win32 console executable.</entry>
1213 </row>
1214
1215 <row>
1216 <entry>win32gui</entry>
1217
1218 <entry><filename>.exe</filename></entry>
1219
1220 <entry><function>_WinMainCRTStartup</function></entry>
1221
1222 <entry>-</entry>
1223
1224 <entry>-</entry>
1225
1226 <entry>Builds a Win32 GUI executable.</entry>
1227 </row>
1228
1229 <row>
1230 <entry>bootloader</entry>
1231
1232 <entry>-</entry>
1233
1234 <entry>-</entry>
1235
1236 <entry>-</entry>
1237
1238 <entry>-</entry>
1239
1240 <entry>Builds a bootloader.</entry>
1241 </row>
1242
1243 <row>
1244 <entry>bootsector</entry>
1245
1246 <entry>-</entry>
1247
1248 <entry>-</entry>
1249
1250 <entry>-</entry>
1251
1252 <entry>-</entry>
1253
1254 <entry>Builds one or more bootsector
1255 binaries.</entry>
1256 </row>
1257
1258 <row>
1259 <entry>iso</entry>
1260
1261 <entry>-</entry>
1262
1263 <entry>-</entry>
1264
1265 <entry>-</entry>
1266
1267 <entry>-.</entry>
1268
1269 <entry>Builds a bootable CD.</entry>
1270 </row>
1271
1272 <row>
1273 <entry>test</entry>
1274
1275 <entry>.exe</entry>
1276
1277 <entry>_mainCRTStartup</entry>
1278
1279 <entry>-</entry>
1280
1281 <entry>-</entry>
1282
1283 <entry>Builds a testsuite.</entry>
1284 </row>
1285
1286 <row>
1287 <entry>rpcserver</entry>
1288
1289 <entry><filename>.o</filename></entry>
1290
1291 <entry>-</entry>
1292
1293 <entry>-</entry>
1294
1295 <entry>-</entry>
1296
1297 <entry>Generates and builds server code for an RPC
1298 interface.</entry>
1299 </row>
1300
1301 <row>
1302 <entry>rpcclient</entry>
1303
1304 <entry><filename>.o</filename></entry>
1305
1306 <entry>-</entry>
1307
1308 <entry>-</entry>
1309
1310 <entry>-</entry>
1311
1312 <entry>Generates and builds client code for an RPC
1313 interface.</entry>
1314 </row>
1315
1316 <row>
1317 <entry>alias</entry>
1318
1319 <entry>-</entry>
1320
1321 <entry>-</entry>
1322
1323 <entry>-</entry>
1324
1325 <entry>-</entry>
1326
1327 <entry>Module is an alias for another module. This
1328 module type is the only module type for which the
1329 aliasof attribute is applicable. Only the module
1330 install functionality is aliased.</entry>
1331 </row>
1332 </tbody>
1333 </tgroup>
1334 </table>
1335 </listitem>
1336 </varlistentry>
1337
1338 <varlistentry>
1339 <term>extension</term>
1340
1341 <listitem>
1342 <para>Extension of the generated file if such file is
1343 generated for the particular module type.</para>
1344 </listitem>
1345 </varlistentry>
1346
1347 <varlistentry>
1348 <term>entrypoint</term>
1349
1350 <listitem>
1351 <para>Entrypoint symbol of the generated file if such file
1352 is generated for the particular module type.</para>
1353 </listitem>
1354 </varlistentry>
1355
1356 <varlistentry>
1357 <term>baseaddress</term>
1358
1359 <listitem>
1360 <para>Base address of the generated file if such file is
1361 generated for the particular module type.</para>
1362 </listitem>
1363 </varlistentry>
1364
1365 <varlistentry>
1366 <term>mangledsymbols</term>
1367
1368 <listitem>
1369 <para>Controls wether or not to pass --kill-at to dlltool.
1370 If this attribute has the value false then --kill-at is
1371 passed to dlltool. If the value is true, then --kill-at is
1372 not passed to dlltool. If the generated file exports C++
1373 classes then this need to be true.</para>
1374 </listitem>
1375 </varlistentry>
1376
1377 <varlistentry>
1378 <term>installbase</term>
1379
1380 <listitem>
1381 <para>Base directory of the generated file in the
1382 installation directory. This attribute is optional.</para>
1383 </listitem>
1384 </varlistentry>
1385
1386 <varlistentry>
1387 <term>installname</term>
1388
1389 <listitem>
1390 <para>Name of generated file in the installation directory.
1391 This attribute is optional, but if not specified, the
1392 generated file is not copied to the installation
1393 directory.</para>
1394 </listitem>
1395 </varlistentry>
1396
1397 <varlistentry>
1398 <term>usewrc</term>
1399
1400 <listitem>
1401 <para>Use WRC to compile resources if true. If false,
1402 windres is used. This attribute is optional. If not
1403 specified, WRC will be used.</para>
1404 </listitem>
1405 </varlistentry>
1406
1407 <varlistentry>
1408 <term>warnings</term>
1409
1410 <listitem>
1411 <para>Error out if false and at least one warning is emitted
1412 during building of this module. This attribute is optional.
1413 If not specified, it is assumed to be false.</para>
1414 </listitem>
1415 </varlistentry>
1416
1417 <varlistentry>
1418 <term>aliasof</term>
1419
1420 <listitem>
1421 <para>Name of module that is aliased.</para>
1422 </listitem>
1423 </varlistentry>
1424 </variablelist></para>
1425 </section>
1426
1427 <section>
1428 <title>Content</title>
1429
1430 <para>None.</para>
1431 </section>
1432
1433 <section>
1434 <title>Parents</title>
1435
1436 <para><link linkend="element.project">project</link>, <link
1437 linkend="element.directory">directory</link>.</para>
1438 </section>
1439
1440 <section>
1441 <title>Children</title>
1442
1443 <para><link linkend="element.bootstrap">bootstrap</link>, <link
1444 linkend="element.component">component</link>, <link
1445 linkend="element.define">define</link>, <link
1446 linkend="element.dependency">dependency</link>, <link
1447 linkend="element.directory">directory</link>, <link
1448 linkend="element.file">file</link>, <link
1449 linkend="element.if">if</link>, <link
1450 linkend="element.importlibrary">importlibrary</link>, <link
1451 linkend="element.include">include</link>, <link
1452 linkend="element.invoke">invoke</link>, <link
1453 linkend="element.library">library</link>, <link
1454 linkend="element.linkerflag">linkerflag</link>, <link
1455 linkend="element.property">property</link>.</para>
1456 </section>
1457 </section>
1458
1459 <section id="element.output">
1460 <title>Output element</title>
1461
1462 <para>An output element specifies a group of filenames that is to be
1463 passed as parameters to a build tool. Output filename parameters are
1464 located before input filename parameters on the command line.</para>
1465
1466 <section>
1467 <title>Syntax</title>
1468
1469 <para><programlisting>&lt;output&gt;
1470 ...
1471 &lt;/output&gt;</programlisting></para>
1472 </section>
1473
1474 <section>
1475 <title>Attributes</title>
1476
1477 <para>None.</para>
1478 </section>
1479
1480 <section>
1481 <title>Content</title>
1482
1483 <para>None.</para>
1484 </section>
1485
1486 <section>
1487 <title>Parents</title>
1488
1489 <para><link linkend="element.invoke">invoke</link></para>
1490 </section>
1491
1492 <section>
1493 <title>Children</title>
1494
1495 <para><link linkend="element.outputfile">outputfile</link>.</para>
1496 </section>
1497 </section>
1498
1499 <section id="element.outputfile">
1500 <title>Outputfile element</title>
1501
1502 <para>An outputfile element specifies a filename that is to be passed
1503 as a parameter to a build tool.</para>
1504
1505 <section>
1506 <title>Syntax</title>
1507
1508 <para><programlisting>&lt;outputfile switches="<replaceable>-H</replaceable>"&gt;<replaceable>../include/reactos/bugcodes.h</replaceable>&lt;/outputfile&gt;</programlisting></para>
1509 </section>
1510
1511 <section>
1512 <title>Attributes</title>
1513
1514 <para><variablelist>
1515 <varlistentry>
1516 <term>switches</term>
1517
1518 <listitem>
1519 <para>Switches that are passed as parameters just before the
1520 filename. This attribute is optional.</para>
1521 </listitem>
1522 </varlistentry>
1523 </variablelist></para>
1524 </section>
1525
1526 <section>
1527 <title>Content</title>
1528
1529 <para>Name of file that is to be passed as a parameter to the build
1530 tool.</para>
1531 </section>
1532
1533 <section>
1534 <title>Parents</title>
1535
1536 <para><link linkend="element.output">output</link>.</para>
1537 </section>
1538
1539 <section>
1540 <title>Children</title>
1541
1542 <para>None.</para>
1543 </section>
1544 </section>
1545
1546 <section id="element.pch">
1547 <title>Pch element</title>
1548
1549 <para>A pch element specifies a GCC precompiled header file.</para>
1550
1551 <section>
1552 <title>Syntax</title>
1553
1554 <para><programlisting>&lt;pch&gt;<replaceable>ntdll.h</replaceable>&lt;/pch&gt;</programlisting></para>
1555 </section>
1556
1557 <section>
1558 <title>Attributes</title>
1559
1560 <para>None.</para>
1561 </section>
1562
1563 <section>
1564 <title>Content</title>
1565
1566 <para>Name of the include file to be precompiled.</para>
1567 </section>
1568
1569 <section>
1570 <title>Parents</title>
1571
1572 <para><link linkend="element.directory">directory</link>.</para>
1573 </section>
1574
1575 <section>
1576 <title>Children</title>
1577
1578 <para>None.</para>
1579 </section>
1580 </section>
1581
1582 <section id="element.project">
1583 <title>Project element</title>
1584
1585 <para>There can be one <sgmltag class="element">project</sgmltag> per
1586 top-level XML build file. A project can only be defined in a top-level
1587 XML build file.</para>
1588
1589 <section>
1590 <title>Syntax</title>
1591
1592 <para><programlisting>&lt;project name="ReactOS" makefile="Makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude"&gt;
1593 ...
1594 &lt;/project&gt;</programlisting></para>
1595 </section>
1596
1597 <section>
1598 <title>Attributes</title>
1599
1600 <para><variablelist>
1601 <varlistentry>
1602 <term>name</term>
1603
1604 <listitem>
1605 <para>Name of the project.</para>
1606 </listitem>
1607 </varlistentry>
1608
1609 <varlistentry>
1610 <term>makefile</term>
1611
1612 <listitem>
1613 <para>Filename of the GNU makefile that is to be
1614 created.</para>
1615 </listitem>
1616 </varlistentry>
1617 </variablelist></para>
1618 </section>
1619
1620 <section>
1621 <title>Content</title>
1622
1623 <para>None.</para>
1624 </section>
1625
1626 <section>
1627 <title>Parents</title>
1628
1629 <para>None. This is the top-level (root) element of
1630 <filename>ReactOS.xml</filename> file.</para>
1631 </section>
1632
1633 <section>
1634 <title>Children</title>
1635
1636 <para><link linkend="element.define">define</link>, <link
1637 linkend="element.directory">directory</link>, <link
1638 linkend="element.if">if</link>, <link
1639 linkend="element.include">include</link>, <link
1640 linkend="element.module">module</link>, <link
1641 linkend="element.property">property</link>.</para>
1642 </section>
1643 </section>
1644
1645 <section id="element.property">
1646 <title>Property element</title>
1647
1648 <para>A property element specifies the name and value of a property
1649 that can be used for conditional processing of the XML build
1650 file.</para>
1651
1652 <section>
1653 <title>Syntax</title>
1654
1655 <para><programlisting>&lt;property name="<replaceable>mypropertyname</replaceable>" value="<replaceable>mypropertyvalue</replaceable>" /&gt;</programlisting></para>
1656 </section>
1657
1658 <section>
1659 <title>Attributes</title>
1660
1661 <para><variablelist>
1662 <varlistentry>
1663 <term>name</term>
1664
1665 <listitem>
1666 <para>Name of property.</para>
1667 </listitem>
1668 </varlistentry>
1669
1670 <varlistentry>
1671 <term>value</term>
1672
1673 <listitem>
1674 <para>Value of property.</para>
1675 </listitem>
1676 </varlistentry>
1677 </variablelist></para>
1678 </section>
1679
1680 <section>
1681 <title>Content</title>
1682
1683 <para>None.</para>
1684 </section>
1685
1686 <section>
1687 <title>Parents</title>
1688
1689 <para></para>
1690 </section>
1691
1692 <section>
1693 <title>Children</title>
1694
1695 <para>None.</para>
1696 </section>
1697 </section>
1698
1699 <section id="element.symbol">
1700 <title>Symbol element</title>
1701
1702 <para>A symbol element specifies an imported function from a library
1703 that is to be stubbed so tests can be run without actually calling the
1704 function in the library.</para>
1705
1706 <section>
1707 <title>Syntax</title>
1708
1709 <para><programlisting>&lt;symbol newname="<replaceable>RtlAllocateHeap</replaceable>"&gt;<replaceable>HeapAlloc@12</replaceable>&lt;/symbol&gt;</programlisting></para>
1710 </section>
1711
1712 <section>
1713 <title>Attributes</title>
1714
1715 <para><variablelist>
1716 <varlistentry>
1717 <term>newname</term>
1718
1719 <listitem>
1720 <para>New name of symbol. This attribute is optional.</para>
1721 </listitem>
1722 </varlistentry>
1723 </variablelist></para>
1724 </section>
1725
1726 <section>
1727 <title>Content</title>
1728
1729 <para>Name of symbol.</para>
1730 </section>
1731
1732 <section>
1733 <title>Children</title>
1734
1735 <para>None.</para>
1736 </section>
1737 </section>
1738 </section>
1739 </chapter>
1740
1741 <bibliography>
1742 <title>Bibliography</title>
1743
1744 <bibliomixed><title><ulink
1745 url="http://www.w3.org/TR/2004/REC-xml-20040204/">Extensible Markup
1746 Language (XML) 1.0 (Third Edition)</ulink></title><releaseinfo>W3C
1747 Recommendation</releaseinfo><author>
1748 <firstname>Fran&ccedil;ois</firstname>
1749
1750 <surname>Yergeau</surname>
1751 </author><author>
1752 <firstname>Tim</firstname>
1753
1754 <surname>Bray</surname>
1755 </author><author>
1756 <firstname>Jean</firstname>
1757
1758 <surname>Paoli</surname>
1759 </author><author>
1760 <firstname>C. M.</firstname>
1761
1762 <surname>Sperberg-McQueen</surname>
1763 </author><author>
1764 <firstname>Eve</firstname>
1765
1766 <surname>Maler</surname>
1767 </author><date>4th February 2004</date></bibliomixed>
1768
1769 <bibliomixed><title><ulink
1770 url="http://www.w3.org/TR/2004/REC-xinclude-20041220/">XML Inclusions
1771 (XInclude) Version 1.0 </ulink></title><releaseinfo>W3C
1772 Recommendation</releaseinfo><editor>
1773 <firstname>Jonathan</firstname>
1774
1775 <surname>Marsh</surname>
1776
1777 <affiliation>
1778 <orgname>Microsoft</orgname>
1779 </affiliation>
1780
1781 <email>jmarsh@microsoft.com</email>
1782 </editor><editor>
1783 <firstname>David</firstname>
1784
1785 <surname>Orchard</surname>
1786
1787 <affiliation>
1788 <orgname>BEA Systems</orgname>
1789 </affiliation>
1790
1791 <email>dorchard@bea.com</email>
1792 </editor>20 December 2004</bibliomixed>
1793 </bibliography>
1794 </book>