1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5<meta http-equiv="Content-Style-Type" content="text/css">
6<title>Build System</title>
7<style type="text/css">
8<!--
9body {
10/*
11    font-size       : 10pt;
12*/
13    font-weight     : normal;
14    color           : #000000;
15    margin          : 8px;
16}
17
18div {
19    width           : 98%;
20    white-space     : nowrap;
21}
22
23div.title {
24    text-align      : left;
25    font-weight     : bold;
26/*
27    font-size       : 16pt;
28*/
29    font-size       : 150%;
30    color           : #202020;
31    border-style    : double;
32    border-width    : 8px;
33    /* タイトルを囲む枠線の色を指定 */
34    border-color    : #CD202C;
35
36    margin          : 4px;
37    padding         : 4px;
38}
39
40h1 {
41    font-size		: 150%;
42    font-family		: Arial;
43    border-bottom-width	: 5px;
44    border-bottom-style	: solid;
45    border-bottom-color	: #CD202C;
46    padding-bottom	: 1px;
47    margin-bottom	: 20px;
48    letter-spacing	: normal;
49    font-weight		: bold;
50}
51
52h2 {
53    font-weight     : bold;
54/*
55    font-size       : 16pt;
56*/
57    font-size       : 150%;
58    border-style    : none none solid double;
59    border-width    : 0px 0px 2px 8px;
60    /* 見出しの線の色を指定 */
61    border-color    : #CD202C;
62
63    margin-left     : 2px;
64    padding-left    : 4px;
65}
66h3
67{
68    font-weight     : bold;
69    font-size       : 120%;
70
71    margin          : 20px 0px 10px 3px;
72    padding         : 0px;
73
74    border-style    : none none solid none;
75    border-width    : 0px 0px 2px 0px;
76    border-color    : #CD202C;
77}
78td {
79  vertical-align    : top;
80}
81th {
82  vertical-align    : top;
83}
84
85table.table, table.table td, table.table th
86{
87	border: solid 2px white;
88	border-collapse: collapse;
89	background-color: #e8f4f4;
90	vertical-align: middle;
91	padding: 0.2em 0.5em 0.2em 0.5em;
92}
93table.table th
94{
95	background-color: #c0d8d8;
96}
97
98pre
99{
100    font-family         : "Courier New", monospace;
101    font-weight         : normal;
102
103    margin              : 10pt 10pt 10pt 10pt;
104    padding             : 2pt 8pt 2pt 8pt;
105    background-color    : #eee;
106
107    border-style        : solid;
108    border-width        : 1px;
109}
110
111p {
112    margin-left     : 4px;
113}
114.enable   { background :#ffcccc; text-align : center }
115.disable  { text-align : center }
116.exsample {
117    border-style       : none none none none;
118    background         : #e8f4f4;
119}
120
121-->
122</style>
123
124</head>
125<body>
126<h1>Build System</h1>
127<h2>Table of Contents</h2>
128<ul style='list-style-type: none'>
129    <li>1. <a href="#omake_rule">Using the <CODE>omake</CODE> Tool</a></li>
130        <ul style='list-style-type: none'>
131            <li>1.1 <a href="#omake_command">The <CODE>omake</CODE> Command</a></li>
132            <li>1.2 <a href="#omake_option"><CODE>omake</CODE> Options</a></li>
133            <li>1.3 <a href="#omake_target"><CODE>omake</CODE> Targets</a></li>
134            <li>1.4 <a href="#omake_param"><CODE>omake</CODE> Variables</a></li>
135        </ul>
136    <li>2. <a href="#buildswitch">How to Use Build Switches</a></li>
137        <ul style='list-style-type: none'>
138            <li>2.1 <a href="#build_env">Environment Variables Available When Building the SDK</a></li>
139            <li>2.2 <a href="#build_option">Build Options Available When Building the SDK</a></li>
140            <li>2.3 <a href="#build_param">Build Variables Configurable Within CTR-SDK's <CODE>OMakefile</CODE></a></li>
141            <ul style='list-style-type: none'>
142                <li>■<a href="#makerom"><CODE>ctr_makerom</CODE></a></li>
143                <li>■<a href="#shader">Shader Assembler and Linker</a></li>
144            </ul>
145        </ul>
146    <li>3. <a href="#macro">Macros</a></li>
147    <li>4. <a href="#omakefile"><CODE>OMakefile</CODE></a>
148        <ul style='list-style-type: none'>
149            <li>4.1 <a href="#must_setting">Required Settings for Creating Applications</a></li>
150            <li>4.2 <a href="#various_setting">Settings for Specific Uses</a></li>
151            <ul style='list-style-type: none'>
152                <li>■<a href="#master_setting">Settings Required to Create Applications for Master Submission</a></li>
153                <li>■<a href="#dlp_setting">Settings Required to Create Applications for Download Play</a></li>
154                <li>■<a href="#sdapi_setting">Settings Required to Create Download Applications</a></li>
155                <li>■<a href="#buildtype_setting">Branching Conditions by Build Type</a></li>
156            </ul>
157        </ul>
158    </li>
159</ul>
160<br/>
161<h2>1. <a name="omake_rule">Using the <CODE>omake</CODE> Tool</a></h2>
162This document describes the features of <CODE>OMake</CODE>. <CODE>OMake</CODE> is the CTR-SDK's command-line build environment. The following descriptions assume that the build environment can locate the <CODE>omake</CODE> executable through the <CODE>PATH</CODE> environment variable.
163<h3>1.1 <a name="omake_command">The <CODE>omake</CODE> Command</a></h3>
164The <CODE>omake</CODE> command is a tool for automating application build and other procedures. Upon launch, the <CODE>omake</CODE> command loads a file containing build rules (OMakefile in the current directory) and then calls the compiler and linker in accordance with those rules.<br/><br/> CTR-SDK supports <CODE>OMake</CODE> version 0.9.8.5-3. It also supports <CODE>OMake</CODE> 0.9.8.5-3 patch 7, which includes modifications made by Nintendo.<br/><br/> Start the command from the <CODE>Cygwin</CODE> or <CODE>Windows</CODE> command prompt as follows:
165<pre>% omake</pre>
166You can change the behavior of <CODE>omake</CODE> by using options, setting variables, and specifying the target name.<br/>
167<pre>% omake [OPTIONS] [VARIABLE=SETTING] [TARGET_NAME]</pre>
168To facilitate the creation of OMakefiles, CTR-SDK provides files (in the following directories) that contain frequently used build rules.
169<ul>
170  <li>Directory: <CODE>$CTR_SDK/build/omake</CODE></li>
171  <li>Variable, etc., definitions: <CODE>commondefs</CODE></li>
172  <li>Build-rule definitions:  <CODE>modulerules</CODE></li>
173</ul>
174You can include <CODE>commondefs</CODE> and <CODE>modulerules</CODE> in your OMakefile when building your application. See <a href="#omakefile">OMakefile</a> for instructions on coding an OMakefile.
175
176<h3>1.2 <a name="omake_option"><CODE>omake</CODE> Options</a></h3>
177The table below describes some of the more frequently used options specific to <CODE>omake</CODE>.<br/><br/>
178<table class="table"><tbody>
179  <tr>
180    <th>Options</th><th>Description</th>
181  </tr>
182  <tr>
183    <td>--version</td><td>Check the version</td>
184  </tr>
185  <tr>
186    <td>-j &lt;PARALLEL_COUNT&gt;</td><td>Perform the specified number of parallel builds</td>
187  </tr>
188  <tr>
189    <td>--verbose</td><td>Building While Displaying the Command Being Run</td>
190  </tr>
191  <tr>
192    <td>--depend</td><td>Ignore dependencies in build</td>
193  </tr>
194  <tr>
195    <td>-U</td>
196    <td>
197      Ignore dependencies and cache in build. (This is handy when you have deleted a header file, because it discards all cached dependencies when building.)
198    </td>
199  </tr>
200</tbody></table>
201
202<h3>1.3 <a name="omake_target"><CODE>omake</CODE> Targets</a></h3>
203This section describes targets defined by the CTR-SDK build system.
204<h4>[Building]</h4>
205<ul>
206  <li>Commands
207    <pre>% omake</pre>
208    <pre>% omake build</pre>
209  </li>
210  <li>Action<br/>
211    <p>Starts building and creates final target.</p></li>
212  <li>Procedure</li>
213  <ol>
214    <li>Checks the dependencies under <CODE>OMakeroot</CODE></li>
215    <li>Executes the <CODE>omake build</CODE> command in directories where there are dependencies</li>
216    <li>Creates directories as needed</li>
217    <li>Compiles/assembles the files specified for <a href="#SOURCES">SOURCES</a> and generates object files</li>
218    <li>Links the objects and creates the file specified by <a href="#TARGET_PROGRAM">TARGET_PROGRAM</a> (specify the file name in <a href="#TARGET_LIBRARY">TARGET_LIBRARY</a> if you want to generate a library file)</li>
219    <li>If necessary, installs (copies) the generated files to a separate directory</li>
220  </ol>
221</ul>
222<p><CODE>build</CODE> is the default target name when the target value for <CODE>omake</CODE> is omitted. You can thus perform the action of <CODE>omake build</CODE> simply by entering <CODE>omake</CODE>.<br/><br/> OMake starts by checking all dependencies under <CODE>OMakeroot</CODE>. Thus even if you run the <CODE>omake</CODE> command somewhere under <CODE>OMakeroot</CODE>, it performs dependent builds. The command generates the build output in a directory named for the build type of the program being built and other attributes. For example, a build directory could be named <CODE>images/CTR-TS.Process.MPCore.[fast|small]/[Release|Development|Debug]</CODE>. See <a href="#buildswitch">Build Switches</a> below, for information about how to change the target's build type and other attributes.</p>
223<h4>[Deleting]</h4>
224<ul>
225  <li>Commands
226    <pre>% omake clean</pre></li>
227  <li>Action<br/>
228    <p>Deletes files generated by <CODE>omake build</CODE>.</p></li>
229  <li>Procedure</li>
230  <ol>
231    <li>Checks the dependencies under <CODE>OMakeroot</CODE></li>
232    <li>Executes the <CODE>omake clean</CODE> command in directories where there are dependencies</li>
233    <li>Deletes items in <CODE>images</CODE> and <CODE>objects</CODE></li>
234  </ol>
235</ul>
236<h3>1.4 <a name="omake_param"><CODE>omake</CODE> Variables</a></h3>
237The following section describes how to use build switches. This section and <a href="#build_param">Build Variables Configurable Within the CTR-SDK's OMakefile</a> describe the <CODE>omake</CODE> variables. <br/>
238<h2>2. How to Use Build Switches</h2>
239This section describes how to use the environment variables, build options, and build variables available in the CTR-SDK build system.
240
241<h3>2.1 <a name="build_env">Environment Variables Available When Building the SDK</a></h3>
242The following environment variables can be configured for the CTR-SDK build system. If an option is not set, the default value is used.
243
244<table border="1" width="100%" cellspacing="0" cellpadding="2">
245  <COL span="1" width="160">
246  <tbody>
247    <tr bgcolor="#CCFFCC">
248      <th align="center"><strong>Environment Variables</strong></th>
249      <td align="center"><strong>Description</strong></td>
250    </tr>
251    <tr>
252      <th align="left"><a name="CTRSDK_ROOT"><CODE>CTRSDK_ROOT</CODE></a><br/> <font color="#ff0000"><B>[Required]</B></font></th>
253      <td align="left">
254        Directory where CTR-SDK is installed (the directory into which <CODE>$CTR_SDK</CODE> is extracted).<br/><br/> Example (the Windows-format absolute path must be specified):<br/>
255        <table>
256          <td class="exsample"><CODE>CTRSDK_ROOT=C:/CTR_SDK</CODE></td>
257        </table><br/> <strong style="color:#FF6633">Default: None.</strong>
258      </td>
259    </tr>
260    <tr>
261      <th align="left"><CODE><a name="ARMCC">ARMCC41BIN<br/>ARMCC41INC<br/>ARMCC41LIB</a></CODE></th>
262      <td align="left">
263        Directory where the ARM compiler is installed.<br/><br/> <strong style="color:#FF6633">Default: None (normally, these are set automatically during installation of the ARM compiler)</strong>
264      </td>
265    </tr>
266    <tr>
267      <th align="left"><a name="CTRSDK_RVCT_VER"><CODE>CTRSDK_RVCT_VER</CODE></a></th>
268      <td align="left">
269        Sets the ARM compiler version to use for the build. If the environment variables corresponding to the specified ARM compiler have not been set, the newest ARM compiler that supports CTR-SDK is used.<br/> <font color="#ff0000">Operation is currently not guaranteed on compilers other than ARMCC 4.1.</font><br/><br/> Example (to build with ARMCC 4.1):<br/><br/>
270        <table>
271          <td class="exsample"><CODE>CTRSDK_RVCT_VER=41</CODE></td>
272        </table><br/> <strong style="color:#FF6633">Default: 41 (build with ARMCC 4.1)</strong>
273      </td>
274    </tr>
275    <tr>
276      <th align="left"><a name="CTRSDK_TARGETS"><CODE>CTRSDK_TARGETS</CODE></a></th>
277      <td align="left">
278        Sets the target hardware and optimization type in environment variables.<br/> The only specifiable hardware is <CODE>TS</CODE>, and the specifiable optimization types are <CODE>fast</CODE> and <CODE>small</CODE>.<br/> <font color="#ff0000">If <CODE><a href="#FILTER">FILTER</a></CODE> is set, these options are ignored.</font><br/><br/>
279        <table cellspacing="1" border="1" bgcolor="#CCFFCC">
280          <col span="1" width="120">
281          <tbody>
282            <tr>
283              <td><strong><CODE>CTR-TS.*</CODE></strong></td>
284              <td>Development hardware (debugger hardware or development system)</td>
285            </tr>
286          </tbody>
287        </table><br/>
288        <table cellspacing="1" border="1" bgcolor="#CCFFCC">
289          <col span="1" width="120">
290          <tbody>
291            <tr>
292              <td><strong><CODE>*.fast</CODE></strong></td>
293              <td>Optimized for speed</td>
294            </tr>
295            <tr>
296              <td><strong><CODE>*.small</CODE></strong></td>
297              <td>Optimized for size</td>
298            </tr>
299          </tbody>
300        </table><br/> Example (when supporting only <CODE>fast</CODE> builds on development hardware):<br/>
301        <table>
302          <td class="exsample"><CODE>CTRSDK_TARGETS=CTR-TS.Process.MPCore.fast</CODE></td>
303        </table>
304        Example (when supporting both <CODE>fast</CODE> and <CODE>small</CODE> builds on development hardware):<br/>
305        <table>
306          <td class="exsample"><CODE>CTRSDK_TARGETS=CTR-TS.Process.MPCore.*</CODE></td>
307        </table><br/> <strong style="color:#FF6633">Default: <CODE>CTR-TS*MPCore*</CODE> (when supporting both <CODE>fast</CODE> and <CODE>small</CODE> on development hardware)</strong>
308      </td>
309    </tr>
310  </tbody>
311</table>
312<br/>
313<h3>2.2 <a name="build_option">Build Options Available When Building the SDK</a></h3>
314The following are build options used when building the CTR-SDK (using the build system).<br/> These can be specified as arguments to the <CODE>omake</CODE> command.<br/> If an option is not set, the default value is used. <br/>
315<table border="1" width="100%" cellspacing="0" cellpadding="2">
316  <COL span="1" width="160">
317  <tbody>
318    <tr bgcolor="#CCFFCC">
319      <th align="center"><strong>Build Options</strong></th>
320      <td align="center"><strong>Description</strong></td>
321    </tr>
322    <tr>
323      <th align="left"><a name="BUILD"><CODE>BUILD</CODE></a></th>
324      <td align="left">
325        Sets the target build type.<br/> The four possible settings are <CODE>Debug</CODE>, <CODE>Development</CODE>, <CODE>Release</CODE>, and <CODE>full</CODE>. Specify <CODE>full</CODE> to build all build types. You can specify multiple types by delimiting them with commas.<br/><br/> Changing this setting changes the compile options and the libraries that are linked when running the <CODE>omake</CODE> command.<br/><br/> The details for each build type are as follows.<br/>
326        <table cellspacing="1" border="1" bgcolor="#e8f4f4">
327          <col span="1" width="120">
328          <tbody>
329            <tr bgcolor="#CCFFCC">
330              <td width="40%" align="center"><strong>Features</strong></td>
331              <td width="20%" align="center"><strong>Debug</strong></td>
332              <td width="20%" align="center"><strong>Development</strong></td>
333              <td width="20%" align="center"><strong><CODE>Release</CODE></strong></td>
334            </tr>
335            <tr>
336              <td><strong>Operations guaranteed</strong></td>
337              <td class="disable">No</td>
338              <td colspan="2" class="enable">Yes</td>
339            </tr>
340            <tr>
341              <td><strong>Debug Output Functions from OS API</strong></td>
342              <td colspan="2" class="enable">Enabled</td>
343              <td class="disable">Disabled</td>
344            </tr>
345            <tr>
346              <td><strong>Application Optimization</strong></td>
347              <td colspan="2" class="disable">OFF</td>
348              <td class="enable">ON</td>
349            </tr>
350            <tr>
351              <td><strong>Library Optimization</strong></td>
352              <td class="disable">OFF</td>
353              <td colspan="2" class="enable">ON</td>
354            </tr>
355            <tr>
356              <td><strong>CTR-SDK Internal Debugging Code</strong></td>
357              <td colspan="2" class="enable">Enabled</td>
358              <td class="disable">Disabled</td>
359            </tr>
360            <tr>
361              <td><strong>ASSERT</strong></td>
362              <td colspan="2" class="enable">Enabled</td>
363              <td class="disable">Disabled</td>
364            </tr>
365            <tr>
366              <td><strong>HostIO</strong></td>
367              <td colspan="2" class="enable">Enabled</td>
368              <td class="disable">Disabled</td>
369            </tr>
370          </tbody>
371        </table><br/> <CODE>Debug</CODE> builds disable the <CODE>gnu</CODE> extensions.<br/> Although debug information is included in the <CODE>Release</CODE> build object files, it is removed by <CODE>makerom</CODE>.<br/><br/> <strong style="color:#FF6633">Default: Development</strong>
372      </td>
373    </tr>
374    <tr>
375      <th align="left"><a name="DEBUG_PRINT"><CODE>DEBUG_PRINT</CODE></a></th>
376      <td align="left">
377        Enables or disables debug output functions regardless of build type.<br/> Specifying <CODE>true</CODE> to the macro enables <CODE>NN_LOG</CODE> (OS debug output); specifying <CODE>false</CODE> leaves <CODE>NN_LOG</CODE> empty.<br/><br/> However, the debug output used in CTR-SDK cannot be enabled or disabled.<br/><br/> <strong style="color:#FF6633">Default: For release builds: <CODE>false</CODE>; Otherwise: <CODE>true</CODE>.
378      </td>
379    </tr>
380    <tr>
381      <th align="left"><a name="ASSERT_WARNING"><CODE>ASSERT_WARNING</CODE></a></th>
382      <td align="left">
383        Enables or disables ASSERTs and WARNINGs regardless of build type.<br/> Specifying <CODE>true</CODE> to the macro enables <CODE>NN_*ASSERT/NN_WARNING</CODE>; specifying <CODE>false</CODE> leaves <CODE>NN_*ASSERT/NN_WARNING</CODE> empty.<br/><br/> However, CTR-SDK ASSERTs and WARNINGs cannot be enabled or disabled.<br/><br/> <strong style="color:#FF6633">Default: For release builds: <CODE>false</CODE>; Otherwise: <CODE>true</CODE>.
384      </td>
385    </tr>
386    <tr>
387      <th align="left"><a name="FILTER"><CODE>FILTER</CODE></a></th>
388      <td align="left">
389        Sets the target hardware and optimization type.<br/> The only specifiable hardware is <CODE>TS</CODE>, and the specifiable optimization types are <CODE>fast</CODE> and <CODE>small</CODE>.<br/> <font color="#ff0000">If these are set, the <a href="#CTRSDK_TARGETS"><CODE>CTRSDK_TARGETS</CODE></a> setting is ignored.</font><br/><br/>
390        <table cellspacing="1" border="1" bgcolor="#CCFFCC">
391          <col span="1" width="120">
392          <tbody>
393            <tr>
394              <td><strong><CODE>CTR-TS.*</CODE></strong></td>
395              <td>Development hardware (debugger hardware or development system)</td>
396            </tr>
397          </tbody>
398        </table><br/>
399        <table cellspacing="1" border="1" bgcolor="#CCFFCC">
400          <col span="1" width="120">
401          <tbody>
402            <tr>
403              <td><strong><CODE>*.fast</CODE></strong></td>
404              <td>Optimized for speed</td>
405            </tr>
406            <tr>
407              <td><strong><CODE>*.small</CODE></strong></td>
408              <td>Optimized for size</td>
409            </tr>
410          </tbody>
411        </table><br/> Example (when supporting only <CODE>fast</CODE> builds on development hardware):<br/>
412        <table>
413          <td class="exsample"><CODE>FILTER=CTR-TS.Process.MPCore.fast</CODE></td>
414        </table>
415        Example (when supporting both <CODE>fast</CODE> and <CODE>small</CODE> builds on development hardware):<br/>
416        <table>
417          <td class="exsample"><CODE>FILTER=CTR-TS.Process.MPCore.*</CODE></td>
418        </table><br/> <strong style="color:#FF6633">Default: <CODE>CTR-TS*MPCore*</CODE> (when supporting both <CODE>fast</CODE> and <CODE>small</CODE> on development hardware)</strong>
419      </td>
420    </tr>
421  </tbody>
422</table>
423<br/>
424<h3>2.3 <a name="build_param">Build Variables Configurable Within CTR-SDK's <CODE>OMakefile</CODE></a></h3>
425The following options are available for setting build conditions per directory in the CTR-SDK <CODE>OMakefile</CODE>.<br/>If an option is not set, the default value is used.<br/><br/>If you specify a path for the build variables below, you must generally specify the Windows-format absolute path or the relative path. You must generally set these build variables before referencing <CODE>modulerules</CODE>. <br/>
426<table border="1" width="100%" cellspacing="0" cellpadding="2">
427  <COL span="1" width="160">
428  <tbody>
429    <tr bgcolor="#CCFFCC">
430      <th width="20%" align="center"><strong>Build Variable</strong></th>
431      <td width="60%" align="center"><strong>Description</strong></td>
432    </tr>
433    <tr>
434      <th align="left"><a name="SUPPORTED_TARGETS"><CODE>SUPPORTED_TARGETS</CODE></a><br/> <font color="#ff0000"><B>[Required]</B></font></th>
435      <td align="left">
436        Sets the targets supported by the program.<br/> The only specifiable hardware is <CODE>TS</CODE>, and the specifiable optimization types are <CODE>fast</CODE> and <CODE>small</CODE>.<br/><br/>
437        <table cellspacing="1" border="1" bgcolor="#CCFFCC">
438          <col span="1" width="120">
439          <tbody>
440            <tr>
441              <td><strong><CODE>CTR-TS.*</CODE></strong></td>
442              <td>Development hardware (debugger hardware or development system)</td>
443            </tr>
444          </tbody>
445        </table><br/>
446        <table cellspacing="1" border="1" bgcolor="#CCFFCC">
447          <col span="1" width="120">
448          <tbody>
449            <tr>
450              <td><strong><CODE>*.fast</CODE></strong></td>
451              <td>Optimized for speed</td>
452            </tr>
453            <tr>
454              <td><strong><CODE>*.small</CODE></strong></td>
455              <td>Optimized for size</td>
456            </tr>
457          </tbody>
458        </table><br/> Example (when supporting only <CODE>fast</CODE> builds on development hardware):<br/>
459        <table>
460          <td class="exsample"><CODE>SUPPORTED_TARGETS = CTR-TS.Process.MPCore.fast</CODE></td>
461        </table>
462        Example (when supporting both <CODE>fast</CODE> and <CODE>small</CODE> builds on development hardware):<br/>
463        <table>
464          <td class="exsample"><CODE>SUPPORTED_TARGETS = CTR-TS.Process.MPCore.*</CODE></td>
465        </table><br/> <strong style="color:#FF6633">Default: None.</strong>
466      </td>
467    </tr>
468    <tr>
469      <th align="left"><a name="CTR_APPTYPE"><CODE>CTR_APPTYPE</CODE></a></th>
470      <td align="left">
471        Sets the type of CTR application to create. You can specify multiple types by delimiting them with spaces.<br/> <font color="#ff0000">You must configure this variable between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/>
472        <table cellspacing="1" border="1" bgcolor="#CCFFCC">
473          <col span="1" width="120">
474          <tbody>
475            <tr>
476              <td><strong>Card</strong></td>
477              <td>Creates a CCI file for card-based software.</td>
478            </tr>
479            <tr>
480              <td><strong><CODE>NAND</CODE></strong></td>
481              <td>Creates a CIA file for DLP child devices.</td>
482            </tr>
483            <tr>
484              <td><strong><CODE>SD</CODE></strong></td>
485              <td>Creates a CIA file for downloadable applications.</td>
486            </tr>
487            <tr>
488              <td><strong><CODE>LIST</CODE></strong></td>
489              <td>Creates a CCL file.</td>
490            </tr>
491          </tbody>
492        </table><br/> <strong style="color:#FF6633">Default: CARD</strong>
493    </tr>
494    <tr>
495      <th align="left"><a name="SOURCES"><CODE>SOURCES</CODE></a></th>
496      <td align="left">
497        Enumerates the source files to be compiled or assembled.<br/> The build system attempts to generate object files using the compiler or assembler that is appropriate for a given file extension, such as <CODE>.c</CODE>, <CODE>.cpp</CODE>, or <CODE>.s</CODE>.<br/> <font color="#ff0000">You must configure this variable between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/> <strong style="color:#FF6633">Default: None.</strong>
498      </td>
499    </tr>
500    <tr>
501      <th align="left"><a name="INCLUDES"><CODE>INCLUDES</CODE></a></th>
502      <td align="left">
503        Specifies the directory if there are any include files specific to this program.<br/> <font color="#ff0000">By default, this variable is set to the <CODE>$CTR-SDK/include</CODE> and <CODE>$OMAKEROOT/include</CODE> directories. Any additional settings must be specified using the <CODE>+=</CODE> operator.</font><br/> <font color="#ff0000">You must configure this variable between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/> <strong style="color:#FF6633">Default: <CODE>$CTR-SDK/include, $OMakeroot/include</CODE></strong>
504      </td>
505    </tr>
506    <tr>
507      <th align="left"><a name="OBJECTS"><CODE>OBJECTS</CODE></a></th>
508      <td align="left">
509        Specifies the object files to link.<br/><br/> Example (linking object file <CODE>xxx.o</CODE>):
510        <table>
511          <td class="exsample"><CODE>OBJECTS = xxx.o</CODE></td>
512        </table><br/> <strong style="color:#FF6633">Default: None.</strong>
513      </td>
514    </tr>
515    <tr>
516      <th align="left"><a name="LIBS"><CODE>LIBS</CODE></a></th>
517      <td align="left">
518        Specifies the libraries to link. The file name extension is not needed.<br/> The build system automatically links several standard libraries, but any special libraries required for a specific program must be explicitly specified here.<br/><br/> A <CODE>fast</CODE> build normally links in the <CODE>libnn_xxx.fast</CODE> library to match the optimization type, but it is also possible to explicitly specify <CODE>libnn_xxx.fast</CODE>.<br/> In this case, the specified library is linked regardless of the optimization type.<br/><br/> <font color="#ff0000">This variable is set by default to the standard library, so any additional settings must be specified using the <CODE>+=</CODE> operator.</font><br/> <font color="#ff0000">You must configure this variable between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/> Example (to link against the additional library <CODE>libnn_xxx</CODE>):<br/>
519        <table>
520          <td class="exsample"><CODE>LIBS += libnn_xxx</CODE></td>
521        </table>
522        Example (to link against the additional library <CODE>libnn_xxx.fast</CODE>):
523        <table>
524          <td class="exsample"><CODE>LIBS += libnn_xxx.fast</CODE></td>
525        </table><br/> <strong style="color:#FF6633">Default: Standard library (see $CTR_SDK/build/omake/platforms/CTR.targetdefs.om)</strong>
526      </td>
527    </tr>
528    <tr>
529      <th align="left"><a name="LIBFILES"><CODE>LIBFILES</CODE></a></th>
530      <td align="left">
531        Specifies program-specific libraries you want to link when building an image with <CODE>TARGET_PROGRAM</CODE> specified.<br/> <font color="#ff0000">You must configure this variable between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/> Example (to add the <CODE>$TMP/libraries/CTR-TS.Process.MPCore/release/libnn_xxx.[fast|small].a</CODE> library):<br/>
532        <table>
533          <td class="exsample"><CODE>LIBFILES = $(TMP)/libraries/CTR-TS.Process.MPCore/release/libnn_xxx</CODE></td>
534        </table><br/> <strong style="color:#FF6633">Default: None.</strong>
535      </td>
536    </tr>
537    <tr>
538      <th align="left"><a name="LIBRARY_LIBFILES"><CODE>LIBRARY_LIBFILES</CODE></a></th>
539      <td align="left">
540        Specifies program-specific libraries you want to link when building an image with <CODE>TARGET_LIBRARY</CODE> specified.<BR> <font color="#ff0000">You must configure this variable between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/> Example (to add the <CODE>$TMP/libraries/CTR-TS.Process.MPCore/release/libnn_xxx.[fast|small].a</CODE> library):<br/>
541        <table>
542<td class="exsample"><CODE>LIBRARY_LIBFILES = $(TMP)/libraries/CTR-TS.Process.MPCore/release/libnn_xxx</CODE></td>
543</table><br/> <strong style="color:#FF6633">Default: None</strong>
544      </td>
545    </tr>
546    <tr>
547      <th align="left"><a name="TARGET_PROGRAM"><CODE>TARGET_PROGRAM</CODE></a></th>
548      <td align="left">
549        Specifies the name of the image to generate. The file name extension is not needed.<br/> Links the object files created by compiling or assembling the source files specified in <a href="#SOURCES">SOURCES</a> and creates the target file. The extension of the created target file is normally <CODE>cci</CODE>.<br/> <font color="#ff0000">Note that the defined <a href="#macro">macro</a> is different when specifying <CODE>TARGET_PROGRAM</CODE> and <CODE>TARGET_LIBRARY</CODE>.</font><br/><br/> <strong style="color:#FF6633">Default: None.</strong>
550      </td>
551    </tr>
552    <tr>
553<th align="left"><a name="TARGET_LIBRARY"><CODE>TARGET_LIBRARY</CODE></a><br/><font color="#ff0000">* CAUTION</font></th>
554      <td align="left">
555        Specifies the names of the library to build. The file name extension is not needed.<br/> Compiles or assembles the source files specified by <a href="#SOURCES">SOURCES</a> and links the resulting object files to create the library.<br/> <font color="#ff0000">Note that the defined <a href="#macro">macro</a> is different when specifying <CODE>TARGET_PROGRAM</CODE> and <CODE>TARGET_LIBRARY</CODE>.</font><br/><br/> <strong style="color:#FF6633">Default: None.</strong>
556      </td>
557    </tr>
558    <tr>
559      <th align="left"><a name="CCFLAGS"><CODE>CCFLAGS</CODE></a></th>
560      <td align="left">
561        Set this variable when you want to change the options passed to the compiler when compiling source files or creating linker script files.<br/> <font color="#ff0000">This variable is set to the required options by default. Any additional options must be specified using the <CODE>+=</CODE> operator.</font><br/><br/> <strong style="color:#FF6633">Default: See <CODE>$CTR_SDK/build/omake/compilers/commondefs.cctype.RVCT.om</CODE></strong>
562      </td>
563    </tr>
564    <tr>
565      <th align="left"><a name="CCFLAGS_WARNING"><CODE>CCFLAGS_WARNING</CODE></a><br/><font color="#ff0000"><B>[Caution]</B></font></th>
566      <td align="left">
567        Set this variable when you want to change the warning options passed to the compiler.<br/> <font color="#ff0000">The warning options should always be set using this variable, not <CODE>CCFLAGS</CODE>.</font><br/> <font color="#ff0000">This variable is set to the required options by default. Any additional options must be specified using the <CODE>+=</CODE> operator.</font><br/><br/> <strong style="color:#FF6633">Default: See <CODE>$CTR_SDK/build/omake/compilers/commondefs.cctype.RVCT.om</CODE></strong>
568      </td>
569    </tr>
570    <tr>
571      <th align="left"><a name="CCFLAGS_DEV_OPT"><CODE>CCFLAGS_DEV_OPT</CODE></a></th>
572      <td align="left">
573        To change the optimization level of an application in a <CODE>Development</CODE> build, set this variable.  The specified optimization level does not affect <CODE>Release</CODE> or <CODE>Debug</CODE> builds.<br/><br/> <strong style="color:#FF6633">Default: See <CODE>$CTR_SDK/build/omake/compilers/commondefs.cctype.RVCT.om</CODE></strong>
574      </td>
575    </tr>
576    <tr>
577      <th align="left"><a name="CFLAGS"><CODE>CFLAGS</CODE></a></th>
578      <td align="left">
579        Set this variable when you want to change the options passed to the compiler only when compiling C files.<br/> <font color="#ff0000">This variable is set to the required options by default. Any additional options must be specified using the <CODE>+=</CODE> operator.</font><br/><br/> <strong style="color:#FF6633">Default: See <CODE>$CTR_SDK/build/omake/compilers/commondefs.cctype.RVCT.om</CODE></strong>
580      </td>
581    </tr>
582    <tr>
583      <th align="left"><a name="CXXFLAGS"><CODE>CXXFLAGS</CODE></a></th>
584      <td align="left">
585        Set this variable when you want to change the options passed to the compiler only when compiling C++ files.<br/> <font color="#ff0000">This variable is set to the required options by default. Any additional options must be specified using the <CODE>+=</CODE> operator.</font><br/><br/> <strong style="color:#FF6633">Default: See <CODE>$CTR_SDK/build/omake/compilers/commondefs.cctype.RVCT.om</CODE></strong>
586      </td>
587    </tr>
588    <tr>
589      <th align="left"><a name="ASFLAGS"><CODE>ASFLAGS</CODE></a></th>
590      <td align="left">
591        Set this variable when you want to change the options passed to the compiler only when compiling assembler files.<br/> <font color="#ff0000">This variable is set to the required options by default. Any additional options must be specified using the <CODE>+=</CODE> operator.</font><br/><br/> <strong style="color:#FF6633">Default: See <CODE>$CTR_SDK/build/omake/compilers/commondefs.cctype.RVCT.om</CODE></strong>
592      </td>
593    </tr>
594    <tr>
595      <th align="left"><a name="LDFLAGS"><CODE>LDFLAGS</CODE></a></th>
596      <td align="left">
597        Set this variable when you want to change the options passed to the linker.<br/> <font color="#ff0000">This variable is set to the required options by default. Any additional options must be specified using the <CODE>+=</CODE> operator.</font><br/><br/> <strong style="color:#FF6633">Default: See <CODE>$CTR_SDK/build/omake/compilers/commondefs.cctype.RVCT.om</CODE></strong>
598      </td>
599    </tr>
600    <tr>
601      <th align="left"><a name="LDFLAGS_WARNING"><CODE>LDFLAGS_WARNING</CODE></a></th>
602      <td align="left">
603        Set this variable when you want to change the warning options passed to the linker.<br/><br/> <font color="#ff0000">This variable is set to the required options by default. Any additional options must be specified using the <CODE>+=</CODE> operator.</font><br/><br/> <strong style="color:#FF6633">Default: See <CODE>$CTR_SDK/build/omake/compilers/commondefs.cctype.RVCT.om</CODE></strong>
604      </td>
605    </tr>
606    <tr>
607      <th align="left"><a name="ENABLE_CPP_EXCEPTION"><CODE>ENABLE_CPP_EXCEPTION</CODE></a></th>
608      <td align="left">
609        Set this to <CODE>true</CODE> to enable C++ exceptions.<br/> <font color="#ff0000">You must configure this variable between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/> <strong style="color:#FF6633">Default: <CODE>false</CODE></strong>
610      </td>
611    </tr>
612    <tr>
613      <th align="left"><a name="INSTALL_ROOT"><CODE>INSTALL_ROOT</CODE></a><br/><font color="#ff0000"><B>[Caution]</B></font></th>
614      <td align="left">
615        Specifies the absolute or relative path to the installation directory.<br/> Use to change the installation directory for libraries and target files.<br/> <font color="#ff0000">This variable must be set before the <CODE>commondefs</CODE> file is included. (Setting the variable within <CODE>OMakeroot</CODE> is one way of ensuring this.)</font><br/><br/> Example (to change the installation directory to <CODE>.tmp</CODE>):<br/>
616        <table>
617          <td class="exsample"><CODE>INSTALL_ROOT = ./tmp</CODE></td>
618        </table><br/> <strong style="color:#FF6633">Default: None.</strong>
619      </td>
620    </tr>
621    <tr>
622      <th align="left"><a name="HOST_IO"><CODE>HOST_IO</CODE></a></th>
623      <td align="left">
624        If set to <CODE>true</CODE>, <CODE>HostIO</CODE> is enabled regardless of build type.<br/><br/> <strong style="color:#FF6633">Default: For release builds: <CODE>false</CODE>; Otherwise: <CODE>true</CODE>.
625      </td>
626    </tr>
627    <tr>
628      <th align="left"><a name="TARGET_BUILDTYPES"><CODE>TARGET_BUILDTYPES</CODE></a></th>
629      <td align="left">
630        Specifies the build type specified on the command line.<br/> Use this variable if you want to exclude a particular build type or in other such cases.<br/> <font color="#ff0000">If you reference or set this variable, you must do so between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/> Example (to exclude <span>Debug</span> builds):<br/><br/>
631        <table>
632          <td class="exsample"><CODE>TARGET_BUILDTYPES = $(filter Release Development, $(TARGET_BUILDTYPES))</CODE></td>
633        </table><br/> <strong style="color:#FF6633">Default: None.</strong>
634      </td>
635    </tr>
636    <tr>
637      <th align="left"><a name="CHILD_APPS"><CODE>CHILD_APPS</CODE></a></th>
638      <td align="left">
639        Specifies the child program to use for Download Play distribution.<br/> You must specify the directory path for this variable in Windows format, using the absolute or relative path. You must set this variable before referencing <CODE>modulerules</CODE>.<br/> <br/> Example (specifying a <CODE>fast</CODE> child in a <CODE>Release</CODE> build):<br/><br/>
640        <table>
641          <td class="exsample">
642    <CODE>CHILD_APPS[] = ../Child/images/CTR-TS.Process.MPCore.fast/Release/Child.cia</CODE></td>
643        </table><br/> <strong style="color:#FF6633">Default: None.</strong>
644      </td>
645    </tr>
646    <tr>
647      <th align="left"><a name="MANUAL_DIR"><CODE>MANUAL_DIR</CODE></a></th>
648      <td align="left">
649        Use this to add an e-manual to the application.<br> Whether it is necessary to add an e-manual to the application depends on the application. For <CODE>MANUAL_DIR</CODE>, specify the directory where the e-manual resides. Place one file in this directory and name the file <CODE>Manual.bcma</CODE>.<br/> You must specify the directory path for this variable in Windows format, using the absolute or relative path. You must set this variable before referencing <CODE>modulerules</CODE>.<br/> <br/>Input example (from <CODE>SampleDemos/demo1/OMakefile</CODE>):)<br/>
650        <table>
651          <td class="exsample"><CODE>MANUAL_DIR = ./manual</CODE></td>
652        </table><br/> <strong style="color:#FF6633">Default: None.</strong>
653      </td>
654    </tr>
655  </tbody>
656</table>
657<br/>
658<h4>■<a name="makerom"><CODE>ctr_makerom</CODE></a></h4>
659<font color="#ff0000">The following settings are reflected in <CODE>ctr_makerom</CODE></font>, even though they are build variables that configure build conditions separately for each directory in the CTR-SDK's OMakefile.<br/><br/>
660<table border="1" width="100%" cellspacing="0" cellpadding="2">
661  <COL span="1" width="160">
662  <tbody>
663    <tr bgcolor="#CCFFCC">
664      <th width="20%" align="center"><strong>Build Variable</strong></th>
665      <td width="60%" align="center"><strong>Description</strong></td>
666    </tr>
667    <tr bgcolor="#FFFFCC">
668      <th align="left"><a name="ROM_SPEC_FILE"><CODE>ROM_SPEC_FILE</CODE></a></th>
669      <td align="left">
670        Specifies an RSF file describing the contents of a ROM file (RomSpecFile).<br/> The file specified here is passed to <CODE>ctr_makerom</CODE> using the <CODE>-rsf</CODE> option, and the CCI files are created based on the settings in this file.<br/> <font color="#ff0000">You must configure this variable between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/> <strong style="color:#FF6633">Default: <CODE>$CTR-SDK/resources/specfiles/Application.rsf</CODE></strong>
671      </td>
672    </tr>
673    <tr bgcolor="#FFFFCC">
674      <th align="left"><a name="DESCRIPTOR"><CODE>DESCRIPTOR</CODE></a></th>
675      <td align="left">
676        Specifies the DESC file.<br/> The file specified here is passed to <CODE>ctr_makerom</CODE> with the <CODE>-desc</CODE> option, and the CCI files are created based on the settings in this file.<br/> <strong style="color:#FF6633">Default: <CODE>$CTR-SDK/resources/specfiles/Application.desc</CODE></strong>
677      </td>
678    </tr>
679    <tr bgcolor="#FFFFCC">
680      <th align="left"><a name="MAKEROMFLAGS"><CODE>MAKEROMFLAGS</CODE></a></th>
681      <td align="left">
682        Set this variable when you want to specify the options passed to <CODE>ctr_makerom</CODE>.<br/> <font color="#ff0000">You must configure this variable between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/> <strong style="color:#FF6633">Default: None.</strong>
683      </td>
684    </tr>
685    <tr bgcolor="#FFFFCC">
686      <th align="left"><a name="ROMFS_ROOT"><CODE>ROMFS_ROOT</CODE></a></th>
687      <td align="left">
688Specifies the root path of the file system to include in the ROM. Although setting this variable has the same effect as setting the <CODE>HostRoot</CODE> in the <CODE>Rom</CODE> section of the RSF file (except for the one point below), if both are set then <CODE>HostRoot</CODE> has precedence.<br/>
689        <ul>
690<li><font color="#ff0000">When <CODE>HostRoot</CODE> is specified in the RSF file, it is not set in the dependency relationships for files and directories under the specified directory. And a build will not be performed, even if the files under the ROM file system are updated.</li>
691        </ul>
692When you would like to set the dependency relationships for files and directories under the directory specified in the RSF file, they must be set with <a href="#ROMFS_DEPENDENCIES">ROMFS_DEPENDENCIES</a>. This variable is also passed to <CODE>ctr_makerom</CODE> using <CODE>-DROMFS_ROOT=</CODE>, so you can reference this value in <CODE>RSF</CODE> with the string &quot;<CODE>$(ROMFS_ROOT)</CODE>&quot;. You must set this variable before referencing <CODE>modulerules</CODE>.<br/><br/><strong style="color:#FF6633"> Default: None</STRONG>
693      </td>
694    </tr>
695    <tr bgcolor="#FFFFCC">
696<th align="left"><a name="ROMFS_DEPENDENCIES"><CODE>ROMFS_DEPENDENCIES</CODE></a></th>
697      <td align="left">
698Sets dependency relationships for files under the specified ROM file system. <br/><br/><font color="#ff0000">Files under the directory specified in <a href="#ROMFS_ROOT">ROMFS_ROOT</a> are configured in <CODE>ROMFS_DEPENDENCIES</CODE> in the build system. However, when setting dependency relationships for files specified in the RSF file, note that they must be set explicitly with this variable. </font><br/>You must set this variable before referencing <CODE>modulerules</CODE>.<br/><br/><strong style="color:#FF6633"> Default: None</STRONG>
699      </td>
700    </tr>
701    <tr bgcolor="#FFFFCC">
702      <th align="left"><a name="TITLE"><CODE>TITLE</CODE></a></th>
703      <td align="left">
704        Specifies the value passed to <CODE>ctr_makerom</CODE> in <CODE>-DTITLE=</CODE>.<br/> The value can be referenced in the RSF file by using <CODE>$(TITLE)</CODE>.<br/><br/> <strong style="color:#FF6633">Default: CtrApp</strong>
705      </td>
706    </tr>
707    <tr bgcolor="#FFFFCC">
708      <th align="left"><a name="CTR_BANNER"><CODE>CTR_BANNER</CODE></a></th>
709      <td align="left">
710      	Specifies the banner file. The value specified here is passed to <CODE>ctr_makerom</CODE> by using the <CODE>-banner</CODE> option.<BR> You must specify <CODE><a href="#CTR_NO_BANNER">CTR_NO_BANNER</a> = true</CODE> or <CODE><a href="#CTR_NO_BANNER_ICON">CTR_NO_BANNER_ICON</a> = true</CODE> when not using banners, otherwise the default value is used if this specification is omitted.<br/> <font color="#ff0000">If <CODE><a href="#CTR_BANNER_SPEC">CTR_BANNER_SPEC</a></CODE> is set, these options are ignored.</font><br/><br/> <strong style="color:#FF6633">Default: <CODE>$CTR_SDK/resources/banner/Default.bnr</CODE></strong>
711      </td>
712    </tr>
713    <tr bgcolor="#FFFFCC">
714      <th align="left"><a name="CTR_ICON"><CODE>CTR_ICON</CODE></a></th>
715      <td align="left">
716      	Specifies the icon file. The value specified here can be passed to <CODE>ctr_makerom</CODE> by using the <CODE>-icon</CODE> option.<BR> You must specify <CODE><a href="#CTR_NO_BANNER_ICON">CTR_NO_BANNER_ICON</a> = true</CODE> if not using icons, otherwise the default value is used if this specification is omitted.<br/>         <font color="#ff0000">If <CODE><a href="#CTR_BANNER_SPEC">CTR_BANNER_SPEC</a></CODE> is set, these options are ignored.</font><br/><br/> <strong style="color:#FF6633">Default: <CODE>$CTR_SDK/resources/banner/Default.icn</CODE></strong>
717      </td>
718    </tr>
719    <tr bgcolor="#FFFFCC">
720      <th align="left"><a name="CTR_NO_BANNER"><CODE>CTR_NO_BANNER</CODE></a></th>
721      <td align="left">
722        This variable must be set to <CODE>true</CODE> if not using banners.<br/> <font color="#ff0000">If <CODE><a href="#CTR_BANNER_SPEC">CTR_BANNER_SPEC</a></CODE> is set, these options are ignored.</font><br/><br/> <strong style="color:#FF6633">Default: None.</strong>
723      </td>
724    </tr>
725    <tr bgcolor="#FFFFCC">
726      <th align="left"><a name="CTR_NO_BANNER_ICON"><CODE>CTR_NO_BANNER_ICON</CODE></a></th>
727      <td align="left">
728        This variable must be set to <CODE>true</CODE> if not using banners or icons.<BR> <font color="#ff0000">If <CODE><a href="#CTR_BANNER_SPEC">CTR_BANNER_SPEC</a></CODE> is set, these options are ignored.</font><br/><br/> <strong style="color:#FF6633">Default: None.</strong>
729      </td>
730    </tr>
731    <tr bgcolor="#FFFFCC">
732      <th align="left"><a name="CTR_BANNER_SPEC"><CODE>CTR_BANNER_SPEC</CODE></a></th>
733      <td align="left">
734        Specifies the BSF file to use as input to <CODE>ctr_makebanner</CODE> (BSF:BannerSpecFile).<br/> The files generated by <CODE>ctr_makebanner</CODE> are input into <CODE>ctr_makerom</CODE> unchanged using the <CODE>-banner</CODE> and <CODE>-icon</CODE> options.<br/> <font color="#ff0000">If these are set, the <CODE><a href="#CTR_BANNER">CTR_BANNER</a></CODE>, <CODE><a href="#CTR_ICON">CTR_ICON</a></CODE>, <CODE><a href="#CTR_NO_BANNER">CTR_NO_BANNER</a></CODE>, and <CODE><a href="#CTR_NO_BANNER_ICON">CTR_NO_BANNER_ICON</a></CODE> settings are ignored.</font><br/><br/> <strong style="color:#FF6633">Default: None.</strong>
735      </td>
736    </tr>
737  </tbody>
738</table>
739<br/>
740<h4>■<a name="shader">Shader Assembler and Linker</a></h4>
741<font color="#ff0000">The following settings relate to the shader assembler and linker</font>, even though they are build variables that configure build conditions separately for each directory in the CTR-SDK OMakefile.<br/><br/>
742<table border="1" width="100%" cellspacing="0" cellpadding="2">
743  <COL span="1" width="160">
744  <tbody>
745    <tr bgcolor="#CCFFCC">
746      <th width="20%" align="center"><strong>Build Variable</strong></th>
747      <td width="60%" align="center"><strong>Description</strong></td>
748    </tr>
749    <tr bgcolor="#CCCCFF">
750      <th align="left"><a name="SHADER_SOURCES"><CODE>SHADER_SOURCES</CODE></a></th>
751      <td align="left">
752        Enumerates the vertex shader assembler files (<CODE>.vsh</CODE>) to be compiled or assembled.<br/><br/> <strong style="color:#FF6633">Default: None.</strong>
753      </td>
754    </tr>
755    <tr bgcolor="#CCCCFF">
756      <th align="left"><a name="SHADER_INCLUDES"><CODE>SHADER_INCLUDES</CODE></a></th>
757      <td align="left">
758        Specifies the directory containing include files referenced when compiling vertex shader assembler files.<br/> <font color="#ff0000">By default, this variable is set to the <CODE>$CTR_SDK/resources/shaders</CODE> directory, so any additional settings must be specified using the <CODE>+=</CODE> operator.</font><br/> <font color="#ff0000">You must configure this variable between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/> <strong style="color:#FF6633">Default: <CODE>$CTR_SDK/resources/shaders</CODE></strong>
759      </td>
760    </tr>
761    <tr bgcolor="#CCCCFF">
762      <th align="left"><a name="SHADER_OBJECTS"><CODE>SHADER_OBJECTS</CODE></a></th>
763      <td align="left">
764        Enumerates the object files to be added during the shader binary build.<br/><br/> <strong style="color:#FF6633">Default: None.</strong>
765      </td>
766    </tr>
767    <tr bgcolor="#CCCCFF">
768      <th align="left"><a name="SHADER_OBJECTS_PREBUILT"><CODE>SHADER_OBJECTS_PREBUILT</CODE></a></th>
769      <td align="left">
770        Enumerates the object files to be added during the shader binary build.<br/> This variable is only used for reserved geometry shaders.<br/> Specify the object files using paths relative to <CODE>$CTR_SDK/resources/shader</CODE>.<br/><br/> <strong style="color:#FF6633">Default: None.</strong>
771      </td>
772    </tr>
773    <tr bgcolor="#CCCCFF">
774      <th align="left"><a name="TARGET_SHADER"><CODE>TARGET_SHADER</CODE></a></th>
775      <td align="left">
776        Specifies the names of the shader binary (SHBIN) files that are ultimately output. The file name extension is not needed.<br/> If you explicitly specify an empty name, the build system assembles without linking.<br/><br/> <strong style="color:#FF6633">Default: shader</strong>
777      </td>
778    </tr>
779    <tr bgcolor="#CCCCFF">
780      <th align="left"><a name="SHBIN_INSTALL_ROOT"><CODE>SHBIN_INSTALL_ROOT</CODE></a></th>
781      <td align="left">
782        Specifies the installation root for the shader binary file.<br/><br/> <strong style="color:#FF6633">Default: Value of <CODE>ROMFS_ROOT</CODE></strong>
783      </td>
784    </tr>
785    <tr bgcolor="#CCCCFF">
786      <th align="left"><a name="SHADER_BINARY"><CODE>SHADER_BINARY</CODE></a></th>
787      <td align="left">
788        Sets the full path of the shader binary file.<br/> To use, do this <font color="#ff0000">after including <CODE>modulerules</CODE></font>.<br/><br/> <strong style="color:#FF6633">Default: Full path to SHBIN file</strong>
789      </td>
790    </tr>
791    <tr bgcolor="#CCCCFF">
792      <th align="left"><a name="SHADER_ASFLAGS"><CODE>SHADER_ASFLAGS</CODE></a></th>
793      <td align="left">
794        Set this variable to change the options assigned to the assembler when assembling vertex shader assembly language files (VSH files).<br/> If you specify the <CODE>-I</CODE> or <CODE>-O</CODE> options, however, use the respective build options.<br/><br/> <font color="#ff0000">Although currently nothing is set by default, use the <CODE>+=</CODE> operator to specify additional options.</font><br/> <font color="#ff0000">You must configure this variable between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/> <strong style="color:#FF6633">Default: None.</strong>
795      </td>
796    </tr>
797    <tr bgcolor="#CCCCFF">
798      <th align="left"><a name="SHADER_LDFLAGS"><CODE>SHADER_LDFLAGS</CODE></a></th>
799      <td align="left">
800        Set this variable when you want to change the options passed to the vertex shader linker.<br/> If you specify the <CODE>-I</CODE> or <CODE>-O</CODE> options, however, use the respective build options.<br/><br/> <font color="#ff0000">Options are set in this variable by default. Use the <CODE>+=</CODE> operator to specify additional options.</font><br/> <font color="#ff0000">You must configure this variable between the <CODE>include</CODE> statements for <CODE>commondefs</CODE> and <CODE>modulerules</CODE>.</font><br/><br/> <strong style="color:#FF6633">Default: -M</strong>
801      </td>
802    </tr>
803  </tbody>
804</table>
805<br/>
806<h2>3. <a name="macro">Macros</h2>
807This section describes C/C++ macros defined by the CTR-SDK.<BR> These macros can access values inside source code. They are used even inside CTR-SDK to switch various features.<BR><BR>
808
809<table border="1" width="100%" cellspacing="0" cellpadding="2">
810  <COL span="1" width="160">
811  <tbody>
812    <tr bgcolor="#CCFFCC">
813      <th align="center"><strong>Macros</strong></th>
814      <td align="center"><strong>Description</strong></td>
815    </tr>
816    <tr>
817<th align="left"><a name="NN_BUILD_DEVELOPMENT"><CODE>NN_BUILD_DEVELOPMENT</CODE></a></th>
818      <td align="left">
819        This macro is defined when building the image specified by <a href="#TARGET_PROGRAM">TARGET_PROGRAM</a> using a &quot;Development&quot; build type.<br/> Note that this macro is not defined when building an image specified by <a href="#TARGET_LIBRARY">TARGET_LIBRARY</a>.<br/><br/>
820      </td>
821    </tr>
822    <tr>
823<th align="left"><a name="NN_BUILD_RELEASE"><CODE>NN_BUILD_RELEASE</CODE></a></th>
824      <td align="left">
825        This macro is defined when building the image specified by <a href="#TARGET_PROGRAM">TARGET_PROGRAM</a> using a &quot;Release&quot; build type.<br/> Note that this macro is not defined when building an image specified by <a href="#TARGET_LIBRARY">TARGET_LIBRARY</a>.<br/><br/>
826      </td>
827    </tr>
828    <tr>
829<th align="left"><a name="NN_BUILD_VERBOSE"><CODE>NN_BUILD_VERBOSE</CODE></a></th>
830      <td align="left">
831        This macro is defined when making builds using the &quot;Debug&quot; or &quot;Development&quot; build type.<BR><BR>
832      </td>
833    </tr>
834    <tr>
835<th align="left"><a name="NN_EFFORT_FAST"><CODE>NN_EFFORT_FAST</CODE></a></th>
836      <td align="left">
837        This macro is defined when making builds using the &quot;fast&quot; optimization type.<BR><BR>
838      </td>
839    </tr>
840    <tr>
841<th align="left"><a name="NN_EFFORT_SMALL"><CODE>NN_EFFORT_SMALL</CODE></a></th>
842      <td align="left">
843        This macro is defined when making builds using the &quot;small&quot; optimization type.<BR><BR>
844      </td>
845    </tr>
846    <tr>
847<th align="left"><a name="NN_SWITCH_DISABLE_DEBUG_PRINT"><CODE>NN_SWITCH_DISABLE_DEBUG_PRINT</CODE></a></th>
848      <td align="left">
849        This macro is defined when making builds using the &quot;Release&quot; build type if <CODE>false</CODE> has been specified for <a href="#DEBUG_PRINT">DEBUG_PRINT</a> or <a href="#DEBUG_PRINT">DEBUG_PRINT</a> has not been specified.
850      </td>
851    </tr>
852    <tr>
853<th align="left"><a name="NN_SWITCH_DISABLE_ASSERT_WARNING"><CODE>NN_SWITCH_DISABLE_ASSERT_WARNING</CODE></a></th>
854      <td align="left">
855        This macro is defined when making builds using the &quot;Release&quot; build type if <CODE>false</CODE> has been specified for <a href="#ASSERT_WARNING">ASSERT_WARNING</a> or <a href="#ASSERT_WARNING">ASSERT_WARNING</a> has not been specified.
856      </td>
857    </tr>
858  </tbody>
859</table>
860<br/>
861
862<h2>4. <a name="omakefile"><CODE>OMakefile</CODE></a></h2>
863Normally, projects that use OMake have an OMakefile in each directory and OMakeroot in the project's root directory. General build settings are specified in <CODE>OMakeroot</CODE> and build parameters specific to each subdirectory are specified in each <CODE>OMakefile</CODE>.<br/><br/> This is also the approach taken by the Sample Demos package in CTR-SDK: There is an <CODE>OMakefile</CODE> in each directory and an <CODE>OMakeroot</CODE> directly under <CODE>SampleDemos</CODE>. The OMakefile files include <CODE>modulerules</CODE> (build rules), while OMakeroot includes <CODE>commondefs</CODE> (general build options).<br/><br/> <STRONG>Note:</STRONG> The following description assumes that your project has the same structure as <CODE>SampleDemos</CODE>.<br/><br/> We start by describing the minimum settings needed to build an application.
864<h3>4.1 <a name="must_setting">Required Settings for Creating Applications</a></h3>
865Required variables: <CODE><a href="#SUPPORTED_TARGETS">SUPPORTED_TARGETS</a></CODE>, <CODE><a href="#SOURCES">SOURCES</a></CODE>, <CODE><a href="#TARGET_PROGRAM">TARGET_PROGRAM</a></CODE>
866<pre>
867SUPPORTED_TARGETS = CTR-TS.Process.MPCore.*    # Target both fast and small builds
868
869SOURCES[]         = main.cpp                   # Build source file &quot;main.cpp&quot;
870
871TARGET_PROGRAM    = test                       # The name of the image to generate is &quot;test&quot;
872
873
874#---- In general, you should not change the following line unless you want to define your own build rules
875include $(ROOT_OMAKE)/modulerules    # Include modulerules
876
877build: $(DEFAULT_TARGETS)            # Configure the rule to run when building
878</pre><br/>
879<h3>4.2 <a name="various_setting">Settings for Specific Uses</a></h3>
880This section describes how to write an <CODE>OMakefile</CODE>. It is based on a concrete scenario.<br/> <STRONG>Note:</STRONG> This code is generally placed before the <CODE>include</CODE> statement for <CODE>modulerules</CODE> in <a href="#must_setting">Required Settings for Creating Applications</a>.<br/><br/>
881<h4>■<a name="master_setting">Settings Required to Create Applications for Master Submission</a></h4>
882Required variables: <CODE><a href="#TITLE">TITLE</a></CODE>, <CODE><a href="#ROMFS_ROOT">ROMFS_ROOT</a></CODE>, <CODE><a href="#CTR_BANNER">CTR_BANNER</a></CODE>, <CODE><a href="#CTR_ICON">CTR_ICON</a></CODE>, <CODE><a href="#ROM_SPEC_FILE">ROM_SPEC_FILE</a></CODE>, <CODE><a href="#DESCRIPTOR">DESCRIPTOR</a></CODE>
883<pre>
884#---- TITLE and ROMFS_ROOT can also be specified in the RSF file
885TITLE             = CtrApp     # Specify the application's title
886ROMFS_ROOT        = ./romfs    # Specify the ROMFS root path
887
888#---- CTR_BANNER and CTR_ICON can also be specified in the BSF file using CTR_BANNER_SPEC
889CTR_BANNER        = $(CTRSDK_ROOT)/resources/banner/Default.bnr          # Specify banner file
890CTR_ICON          = $(CTRSDK_ROOT)/resources/banner/Default.icn          # Specify icon file
891
892
893ROM_SPEC_FILE     = $(CTRSDK_ROOT)/resources/specfiles/Application.rsf   # Specify RSF file
894DESCRIPTOR        = $(CTRSDK_ROOT)/resources/specfiles/Application.desc  # Specify DESC file
895</pre>
896<h4>■<a name="dlp_setting">Settings Required to Create Applications for Download Play</a></h4>
897Required variables: <CODE><a href="#CHILD_APPS">CHILD_APPS</a></CODE>, <CODE><a href="#CTR_APPTYPE">CTR_APPTYPE</a></CODE>, <CODE><a href="#ROM_SPEC_FILE">ROM_SPEC_FILE</a></CODE>, <CODE><a href="#DESCRIPTOR">DESCRIPTOR</a></CODE>, <CODE><a href="#CTR_ICON">CTR_ICON</a></CODE><br/><br/> Parent
898<pre>
899CHILD_APPS[]      = ../Child/images/CTR-TS.Process.MPCore.fast/Release/Child.cia  # Specify child programs
900</pre>
901Child
902<pre>
903CTR_APPTYPE       = NAND
904CTR_ICON          = Child.icn                                         # Specify child icon
905
906ROM_SPEC_FILE     = Child.rsf                                         # Specify UniqueId and ChildIndex in child RSF file
907DESCRIPTOR        = $(CTRSDK_ROOT)/resources/specfiles/DlpChild.desc  # Specify DESC file for children
908</pre>
909<h4>■<a name="sdapi_setting">Settings Required to Create Download Applications</a></h4>
910Required variables: <CODE><a href="#CTR_APPTYPE">CTR_APPTYPE</a></CODE>, <CODE><a href="#MANUAL_DIR">MANUAL_DIR</a></CODE>
911<pre>
912CTR_APPTYPE = SD
913MANUAL_DIR        = ./manual    # Specify directory where e-manual is stored
914</pre>
915<h4>■<a name="buildtype_setting">Branching Conditions by Build Type</a></h4>
916Required variables: <CODE><a href="#TARGET_BUILDTYPES">TARGET_BUILDTYPES</a></CODE><br/><br/>The example below illustrates creating a <CODE>Release</CODE> build only in the &quot;test&quot; directory.<br/>
917<pre>
918if $(equal $(filter Release,$(TARGET_BUILDTYPES)),Release)
919    .SUBDIRS: $(exist-dirs test)
920</pre>
921
922  <hr><p>CTR-06-0205-002-I<br>CONFIDENTIAL</p></body>
923</html>