work in progress by Z98
If you have another program that you wish to compile into ReactOS, you will need the source code as well as create an rbuild config file for it. In this example, we will assume that the program is called foo.
This is the first line. For type, you have the option of using win32cui (console application), win32gui (Windows application), win32ocx (relates to COM), win32dll (Dynamic Linked Libraries), objectlibrary (don't know yet what they are), exportdriver (don't know yet what they are), and kernelmodedriver (hardware driver). The other two are self explanatory. Another option that could be added is unicode="true/false".
<module name="foo" type="win32gui" installname="foo.exe">
This line is only needed if you're trying to export functions. This is most frequently used in DLLs, in which case your file would be located in something like /dll/*/foo. Drivers sometimes also export functions.
<importlibrary definition="foo.def" />
This line is only needed if you need some special header that are not located in the base include directory. Otherwise you don't need to add it in.
With this, you can do something like #include "namedir/foo.h". However, be careful using this. Use of backslashes is liable to break Linux builds. Always use forward(/) slashes. mingw can figure out what you mean.
This statement is the same as a #define in your source code. Using this will make it a global for all files.
This statement is used to designate the use of a precompiled header. Generally you will have to know explicitly which headers are precompiled to use this.
This statement specifies a subdirectory where you want to do something. Once you are done supplying config information, you must close it.
<directory name="stuff"> (various other config options) </directory>
This statement specifies what other modules your module is dependent upon, so that the compiler knows to recompile your module in the event there's a change in the other one.
Next is which libraries you will be using. If you use more than one library, the declaration becomes multi-line.
For this, you need to know what libraries your program will need. If you don't know, you can try compiling the program and see which functions GCC complains about no finding and figure out where they're from.
If you wish to merge several files together and compile them as one file, you will wrap <file> with this.
<compilationunit name = allfoo.c>
Next comes the files that will be compiled.
If you had used <compliationunit> above, you must close it.
You end the rbuild file with this.
Once you're done creating your rbuild file, you must go one level up and add this to the rbuild file there.
<directory name = "foo" <x:include href="foo/foo.rbuild"> </directory>