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>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 the <CODE>OMakefile</CODE> of CTR-SDK</a></li> 141 <ul style='list-style-type: none'> 142 <li>■<a href="#makerom">ctr_makerom</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 Downloadable 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 command-line build environment of CTR-SDK. 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. On start, the <CODE>omake</CODE> command loads a file containing build rules (<CODE>OMakefile</CODE> in the current directory), and then calls the compiler and linker according to 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 operation 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 <CODE>OMakefiles</CODE>, 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>Definitions for variables and other elements: <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 <CODE>OMakefile</CODE> when building your application. For information about coding an <CODE>OMakefile</CODE>, see <a href="#omakefile"><CODE>OMakefile</CODE></a>. 175 176<h3>1.2 <a name="omake_option"><CODE>omake</CODE> Options</a></h3> 177The following table 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><CODE>--version</CODE></td><td>Check the version.</td> 184 </tr> 185 <tr> 186 <td><CODE>-j <PARALLEL_COUNT></CODE></td><td>Perform the specified number of parallel builds.</td> 187 </tr> 188 <tr> 189 <td><CODE>--verbose</CODE></td><td>Build while displaying the command that is being run.</td> 190 </tr> 191 <tr> 192 <td><CODE>--depend</CODE></td><td>Ignore dependencies in the build.</td> 193 </tr> 194 <tr> 195 <td><CODE>-U</CODE></td> 196 <td> 197 Ignore dependencies and the cache in the build. (This option is useful 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 the 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 and assembles the files specified for <CODE><a href="#SOURCES">SOURCES</a></CODE> and generates object files.</li> 218 <li>Links the objects and creates the file specified by <CODE><a href="#TARGET_PROGRAM">TARGET_PROGRAM</a></CODE>. (Specify the filename in <CODE><a href="#TARGET_LIBRARY">TARGET_LIBRARY</a></CODE> 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 perform the <CODE>omake build</CODE> action simply by typing <CODE>omake</CODE>. <br/><br/> <CODE>OMake</CODE> starts by checking all dependencies under <CODE>OMakeroot</CODE>. 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>. For information about how to change the target's build type and other attributes, see <a href="#buildswitch">Build Switches</a>.</p> 223<h4>Deleting</h4> 224<ul> 225 <li>Command 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 <CODE>OMakefile</CODE></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. <br/><br/> 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 Variable</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 hardware setting is <CODE>TS</CODE>, and the optimization type settings 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 build options are used when building the CTR-SDK (using the build system). <br/> They can be specified as arguments to the <CODE>omake</CODE> command. <br/> If an option is not set, the default value is used. <br/> <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>Release</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">Software to Be Tested</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"> 383Enables or disables <CODE>ASSERT</CODE>s and <CODE>WARNING</CODE>s 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 <CODE>ASSERT</CODE>s and <CODE>WARNING</CODE>s cannot be enabled or disabled. <br/><br/><strong style="color:#FF6633">Defaults: For release builds, <CODE>false</CODE>; otherwise, <CODE>true</CODE>.</strong> 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 hardware setting is <CODE>TS</CODE>, and the optimization type settings 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 the <CODE>OMakefile</CODE> of CTR-SDK</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 following build variables, 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 available hardware setting is <CODE>TS</CODE>, and the optimization type settings 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><CODE>CARD</CODE></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: <CODE>CARD</CODE>.</strong> 493 </td> 494 </tr> 495 <tr> 496 <th align="left"><a name="SOURCES"><CODE>SOURCES</CODE></a></th> 497 <td align="left"> 498 Enumerates the source files to compile or assemble. <br/> The build system attempts to generate object files, using the compiler or assembler, for the file extensions <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> 499 </td> 500 </tr> 501 <tr> 502 <th align="left"><a name="INCLUDES"><CODE>INCLUDES</CODE></a></th> 503 <td align="left"> 504 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> 505 </td> 506 </tr> 507 <tr> 508 <th align="left"><a name="OBJECTS"><CODE>OBJECTS</CODE></a></th> 509 <td align="left"> 510 Specifies the object files to link. <br/><br/> Example (linking object file <CODE>xxx.o</CODE>): 511 <table> 512 <td class="exsample"><CODE>OBJECTS = xxx.o</CODE></td> 513 </table><br/> <strong style="color:#FF6633">Default: None</strong> 514 </td> 515 </tr> 516 <tr> 517 <th align="left"><a name="LIBS"><CODE>LIBS</CODE></a></th> 518 <td align="left"> 519 Specifies the libraries to link. The 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. <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/> 520 <table> 521 <td class="exsample"><CODE>LIBS += libnn_xxx</CODE></td> 522 </table> 523 Example (to link against the additional library <CODE>libnn_xxx.fast</CODE>): 524 <table> 525 <td class="exsample"><CODE>LIBS += libnn_xxx.fast</CODE></td> 526 </table><br/> <strong style="color:#FF6633">Default: Standard library (see <CODE>$CTR_SDK/build/omake/platforms/CTR.targetdefs.om</CODE>).</strong> 527 </td> 528 </tr> 529 <tr> 530 <th align="left"><a name="LIBFILES"><CODE>LIBFILES</CODE></a></th> 531 <td align="left"> 532 Specifies program-specific libraries 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/> 533 <table> 534 <td class="exsample"><CODE>LIBFILES = $(TMP)/libraries/CTR-TS.Process.MPCore/release/libnn_xxx</CODE></td> 535 </table><br/> <strong style="color:#FF6633">Default: None</strong> 536 </td> 537 </tr> 538 <tr> 539 <th align="left"><a name="LIBRARY_LIBFILES"><CODE>LIBRARY_LIBFILES</CODE></a></th> 540 <td align="left"> 541 Specifies program-specific libraries 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/> 542 <table> 543 <td class="exsample"><CODE>LIBRARY_LIBFILES = $(TMP)/libraries/CTR-TS.Process.MPCore/release/libnn_xxx</CODE> </td> 544 </table><br/> <strong style="color:#FF6633">Default: None</strong> 545 </td> 546 </tr> 547 <tr> 548 <th align="left"><a name="TARGET_PROGRAM"><CODE>TARGET_PROGRAM</CODE></a></th> 549 <td align="left"> 550 Specifies the name of the image to generate. The extension is not needed. <br/> Links the object files created by compiling or assembling the source files specified in <CODE><a href="#SOURCES">SOURCES</a></CODE> 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> or <CODE>TARGET_LIBRARY</CODE>.</font><br/><br/> <strong style="color:#FF6633">Default: None</strong> 551 </td> 552 </tr> 553 <tr> 554 <th align="left"><CODE><a name="TARGET_LIBRARY">TARGET_LIBRARY</a></CODE><br/><font color="#ff0000">[Caution]</font></th> 555 <td align="left"> 556 Specifies the names of the library to build. The extension is not needed. <br/> Compiles or assembles the source files specified by <CODE><a href="#SOURCES">SOURCES</a></CODE> 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> or <CODE>TARGET_LIBRARY</CODE>.</font><br/><br/> <strong style="color:#FF6633">Default: None</strong> 557 </td> 558 </tr> 559 <tr> 560 <th align="left"><a name="CCFLAGS"><CODE>CCFLAGS</CODE></a></th> 561 <td align="left"> 562 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> 563 </td> 564 </tr> 565 <tr> 566 <th align="left"><a name="CCFLAGS_WARNING"><CODE>CCFLAGS_WARNING</CODE></a><br/><font color="#ff0000"><B>[Caution]</B></font> </th> 567 <td align="left"> 568 Set this variable when you want to change the warning options passed to the compiler. <br/> <font color="#ff0000">Always set the warning options 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> 569 </td> 570 </tr> 571 <tr> 572 <th align="left"><a name="CCFLAGS_DEV_OPT"><CODE>CCFLAGS_DEV_OPT</CODE></a></th> 573 <td align="left"> 574 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> 575 </td> 576 </tr> 577 <tr> 578 <th align="left"><a name="CFLAGS"><CODE>CFLAGS</CODE></a></th> 579 <td align="left"> 580 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> 581 </td> 582 </tr> 583 <tr> 584 <th align="left"><a name="CXXFLAGS"><CODE>CXXFLAGS</CODE></a></th> 585 <td align="left"> 586 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> 587 </td> 588 </tr> 589 <tr> 590 <th align="left"><a name="ASFLAGS"><CODE>ASFLAGS</CODE></a></th> 591 <td align="left"> 592 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> 593 </td> 594 </tr> 595 <tr> 596 <th align="left"><a name="LDFLAGS"><CODE>LDFLAGS</CODE></a></th> 597 <td align="left"> 598 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> 599 </td> 600 </tr> 601 <tr> 602 <th align="left"><a name="LDFLAGS_WARNING"><CODE>LDFLAGS_WARNING</CODE></a></th> 603 <td align="left"> 604 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> 605 </td> 606 </tr> 607 <tr> 608 <th align="left"><a name="ENABLE_CPP_EXCEPTION"><CODE>ENABLE_CPP_EXCEPTION</CODE></a></th> 609 <td align="left"> 610 Set this variable 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> 611 </td> 612 </tr> 613 <tr> 614 <th align="left"><a name="INSTALL_ROOT"><CODE>INSTALL_ROOT</CODE></a><br/><font color="#ff0000"><B>[Caution]</B></font> </th> 615 <td align="left"> 616 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/> 617 <table> 618 <td class="exsample"><CODE>INSTALL_ROOT = ./tmp</CODE></td> 619 </table><br/> <strong style="color:#FF6633">Default: None</strong> 620 </td> 621 </tr> 622 <tr> 623 <th align="left"><a name="HOST_IO"><CODE>HostIO</CODE></a></th> 624 <td align="left"> 625If set to <CODE>true</CODE>, <CODE>HostIO</CODE> is enabled regardless of build type. <br/><br/> <strong style="color:#FF6633">Defaults: For release builds, <CODE>false</CODE>; otherwise, <CODE>true</CODE>.</strong> 626 </td> 627 </tr> 628 <tr> 629 <th align="left"><a name="TARGET_BUILDTYPES"><CODE>TARGET_BUILDTYPES</CODE></a></th> 630 <td align="left"> 631 Specifies the build type specified on the command line. <br/> Use this variable 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/> 632 <table> 633 <td class="exsample"><CODE>TARGET_BUILDTYPES = $(filter Release Development, $(TARGET_BUILDTYPES))</CODE></td> 634 </table><br/> <strong style="color:#FF6633">Default: None</strong> 635 </td> 636 </tr> 637 <tr> 638 <th align="left"><a name="CHILD_APPS"><CODE>CHILD_APPS</CODE></a></th> 639 <td align="left"> 640 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/> 641 <table> 642 <td class="exsample"> 643 <CODE>CHILD_APPS[] = ../Child/images/CTR-TS.Process.MPCore.fast/Release/Child.cia</CODE></td> 644 </table><br/> <strong style="color:#FF6633">Default: None</strong> 645 </td> 646 </tr> 647 <tr> 648 <th align="left"><a name="MANUAL_DIR"><CODE>MANUAL_DIR</CODE></a></th> 649 <td align="left"> 650 Use this variable 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/> 651 <table> 652 <td class="exsample"><CODE>MANUAL_DIR = ./manual</CODE></td> 653 </table><br/> <strong style="color:#FF6633">Default: None</strong> 654 </td> 655 </tr> 656 </tbody> 657</table> 658<br/> 659<h4>■<a name="makerom">ctr_makerom</a></h4> 660<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 <CODE>OMakefile</CODE>. <br/><br/> 661<table border="1" width="100%" cellspacing="0" cellpadding="2"> 662 <COL span="1" width="160"> 663 <tbody> 664 <tr bgcolor="#CCFFCC"> 665 <th width="20%" align="center"><strong>Build Variable</strong></th> 666 <td width="60%" align="center"><strong>Description</strong></td> 667 </tr> 668 <tr bgcolor="#FFFFCC"> 669 <th align="left"><a name="ROM_SPEC_FILE"><CODE>ROM_SPEC_FILE</CODE></a></th> 670 <td align="left"> 671Specifies an RSF file describing the contents of a ROM file (<CODE>RomSpecFile</CODE>). <br/>The specified file is passed to <CODE>ctr_makerom</CODE> using the <CODE>-rsf</CODE> option. The file's settings serve as the basis to the creation of CCI files. <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> 672 </td> 673 </tr> 674 <tr bgcolor="#FFFFCC"> 675 <th align="left"><a name="DESCRIPTOR"><CODE>DESCRIPTOR</CODE></a></th> 676 <td align="left"> 677 Specifies the DESC file. <br/> The specified file 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> 678 </td> 679 </tr> 680 <tr bgcolor="#FFFFCC"> 681 <th align="left"><a name="MAKEROMFLAGS"><CODE>MAKEROMFLAGS</CODE></a></th> 682 <td align="left"> 683 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> 684 </td> 685 </tr> 686 <tr bgcolor="#FFFFCC"> 687 <th align="left"><a name="ROMFS_ROOT"><CODE>ROMFS_ROOT</CODE></a></th> 688 <td align="left"> 689 Specifies 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 following point), if both are set <CODE>HostRoot</CODE> has precedence. <br/> 690 <ul> 691 <li><font color="#ff0000">When <CODE>HostRoot</CODE> is specified in the RSF file, no dependency relationships are set between files and directories under the specified directory. Also, a rebuild is not performed even if the files under the ROM file system have been updated.</font></li> 692 </ul> 693 <font color="#ff0000">When you want to set the dependency relationships for files and directories under the directory specified in the RSF file, you must set them with <a href="#ROMFS_DEPENDENCIES"><CODE>ROMFS_DEPENDENCIES</CODE></a>.</font> This variable is also passed to <CODE>ctr_makerom</CODE> using <CODE>-DROMFS_ROOT=</CODE>. You can reference this value in <CODE>RSF</CODE> with the string "<CODE>$(ROMFS_ROOT)</CODE>". You must set this variable before referencing <CODE>modulerules</CODE>. <br/><br/> <strong style="color:#FF6633">Default: None</strong> 694 </td> 695 </tr> 696 <tr bgcolor="#FFFFCC"> 697 <th align="left"><a name="ROMFS_DEPENDENCIES"><CODE>ROMFS_DEPENDENCIES</CODE></a></th> 698 <td align="left"> 699 Sets dependency relationships for files under the specified ROM file system. <br/><br/> <font color="#ff0000">Files under the directory specified in <CODE><a href="#ROMFS_ROOT">ROMFS_ROOT</a></CODE> are configured in <CODE>ROMFS_DEPENDENCIES</CODE> in the build system. <br/> Note that when setting dependency relationships for files specified in the RSF file, 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> 700 </td> 701 </tr> 702 <tr bgcolor="#FFFFCC"> 703 <th align="left"><a name="TITLE"><CODE>TITLE</CODE></a></th> 704 <td align="left"> 705 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>. 706 </td> 707 </tr> 708 <tr bgcolor="#FFFFCC"> 709 <th align="left"><a name="CTR_BANNER"><CODE>CTR_BANNER</CODE></a></th> 710 <td align="left"> 711 Specifies the banner file. The specified value 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. 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> 712 </td> 713 </tr> 714 <tr bgcolor="#FFFFCC"> 715 <th align="left"><a name="CTR_ICON"><CODE>CTR_ICON</CODE></a></th> 716 <td align="left"> 717 Specifies the icon file. You can pass the specified value 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 you are not using icons. 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> has been set, this setting is ignored.</font><br/><br/><strong style="color:#FF6633">Default: <CODE>$CTR_SDK/resources/banner/Default.icn</CODE>.</strong> 718 </td> 719 </tr> 720 <tr bgcolor="#FFFFCC"> 721 <th align="left"><a name="CTR_NO_BANNER"><CODE>CTR_NO_BANNER</CODE></a></th> 722 <td align="left"> 723This 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> has been set, this setting is ignored.</font><br/><br/><strong style="color:#FF6633">Default: None</strong> 724 </td> 725 </tr> 726 <tr bgcolor="#FFFFCC"> 727 <th align="left"><a name="CTR_NO_BANNER_ICON"><CODE>CTR_NO_BANNER_ICON</CODE></a></th> 728 <td align="left"> 729This variable must be set to <CODE>true</CODE> if you are not using banners or icons. <BR> <font color="#ff0000">If <CODE><a href="#CTR_BANNER_SPEC">CTR_BANNER_SPEC</a></CODE> has been set, this setting is ignored.</font><br/><br/><strong style="color:#FF6633">Default: None</strong> 730 </td> 731 </tr> 732 <tr bgcolor="#FFFFCC"> 733 <th align="left"><a name="CTR_BANNER_SPEC"><CODE>CTR_BANNER_SPEC</CODE></a></th> 734 <td align="left"> 735 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 options 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> 736 </td> 737 </tr> 738 </tbody> 739</table> 740<br/> 741<h4>■<a name="shader">Shader Assembler and Linker</a></h4> 742<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 <CODE>OMakefile</CODE>. <br/><br/> 743<table border="1" width="100%" cellspacing="0" cellpadding="2"> 744 <COL span="1" width="160"> 745 <tbody> 746 <tr bgcolor="#CCFFCC"> 747 <th width="20%" align="center"><strong>Build Variable</strong></th> 748 <td width="60%" align="center"><strong>Description</strong></td> 749 </tr> 750 <tr bgcolor="#CCCCFF"> 751 <th align="left"><a name="SHADER_SOURCES"><CODE>SHADER_SOURCES</CODE></a></th> 752 <td align="left"> 753 Enumerates the vertex shader assembler files (<CODE>.vsh</CODE>) to compile or assemble. <br/><br/> <strong style="color:#FF6633">Default: None</strong> 754 </td> 755 </tr> 756 <tr bgcolor="#CCCCFF"> 757 <th align="left"><a name="SHADER_INCLUDES"><CODE>SHADER_INCLUDES</CODE></a></th> 758 <td align="left"> 759 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> 760 </td> 761 </tr> 762 <tr bgcolor="#CCCCFF"> 763 <th align="left"><a name="SHADER_OBJECTS"><CODE>SHADER_OBJECTS</CODE></a></th> 764 <td align="left"> 765 Enumerates the object files to add during the shader binary build. <br/><br/> <strong style="color:#FF6633">Default: None</strong> 766 </td> 767 </tr> 768 <tr bgcolor="#CCCCFF"> 769 <th align="left"><a name="SHADER_OBJECTS_PREBUILT"><CODE>SHADER_OBJECTS_PREBUILT</CODE></a></th> 770 <td align="left"> 771 Enumerates the object files to add during the shader binary build. <br/> This variable is used only 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> 772 </td> 773 </tr> 774 <tr bgcolor="#CCCCFF"> 775 <th align="left"><a name="TARGET_SHADER"><CODE>TARGET_SHADER</CODE></a></th> 776 <td align="left"> 777 Specifies the names of the shader binary (SHBIN) files that are ultimately output. The extension is not needed. <br/> If you explicitly specify an empty name, the build system only assembles without linking. <br/><br/> <strong style="color:#FF6633">Default: shader</strong>. 778 </td> 779 </tr> 780 <tr bgcolor="#CCCCFF"> 781 <th align="left"><a name="SHBIN_INSTALL_ROOT"><CODE>SHBIN_INSTALL_ROOT</CODE></a></th> 782 <td align="left"> 783 Specifies the installation root directory for the shader binary file. <br/><br/> <strong style="color:#FF6633">Default: Value of <CODE>ROMFS_ROOT</CODE>.</strong> 784 </td> 785 </tr> 786 <tr bgcolor="#CCCCFF"> 787 <th align="left"><a name="SHADER_BINARY"><CODE>SHADER_BINARY</CODE></a></th> 788 <td align="left"> 789 Sets the full path of the shader binary file. <br/> To use, set this path <font color="#ff0000">after including <CODE>modulerules</CODE></font>.<br/><br/> <strong style="color:#FF6633">Default: Full path to the SHBIN file</strong>. 790 </td> 791 </tr> 792 <tr bgcolor="#CCCCFF"> 793 <th align="left"><a name="SHADER_ASFLAGS"><CODE>SHADER_ASFLAGS</CODE></a></th> 794 <td align="left"> 795 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, 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> 796 </td> 797 </tr> 798 <tr bgcolor="#CCCCFF"> 799 <th align="left"><a name="SHADER_LDFLAGS"><CODE>SHADER_LDFLAGS</CODE></a></th> 800 <td align="left"> 801 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, 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>. 802 </td> 803 </tr> 804 </tbody> 805</table> 806<br/> 807<h2>3. <a name="macro">Macros</a></h2> 808This section describes the 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> 809 810<table border="1" width="100%" cellspacing="0" cellpadding="2"> 811 <COL span="1" width="160"> 812 <tbody> 813 <tr bgcolor="#CCFFCC"> 814 <th align="center"><strong>Macros</strong></th> 815 <td align="center"><strong>Description</strong></td> 816 </tr> 817 <tr> 818 <th align="left"><a name="NN_BUILD_DEVELOPMENT"><CODE>NN_BUILD_DEVELOPMENT</CODE> </a></th> 819 <td align="left"> 820 This macro is defined when building the image specified by <a href="#TARGET_PROGRAM"><CODE>TARGET_PROGRAM</CODE></a> using the <CODE>Development</CODE> build type. <br/> Note that this macro is not defined when building an image specified by <a href="#TARGET_LIBRARY"><CODE>TARGET_LIBRARY</CODE></a>. <br/><br/> 821 </td> 822 </tr> 823 <tr> 824 <th align="left"><a name="NN_BUILD_RELEASE"><CODE>NN_BUILD_RELEASE</CODE> </a></th> 825 <td align="left"> 826 This macro is defined when building the image specified by <a href="#TARGET_PROGRAM"><CODE>TARGET_PROGRAM</CODE></a> using the <CODE>Release</CODE> build type. <br/> Note that this macro is not defined when building an image specified by <a href="#TARGET_LIBRARY"><CODE>TARGET_LIBRARY</CODE></a>. <br/><br/> 827 </td> 828 </tr> 829 <tr> 830 <th align="left"><a name="NN_BUILD_VERBOSE"><CODE>NN_BUILD_VERBOSE</CODE> </a></th> 831 <td align="left"> 832 This macro is defined when making builds using the <CODE>Debug</CODE> or <CODE>Development</CODE> build type. <BR><BR> 833 </td> 834 </tr> 835 <tr> 836 <th align="left"><a name="NN_EFFORT_FAST"><CODE>NN_EFFORT_FAST</CODE> </a></th> 837 <td align="left"> 838 This macro is defined when making builds using the "<CODE>fast</CODE>" optimization type. <BR><BR> 839 </td> 840 </tr> 841 <tr> 842 <th align="left"><a name="NN_EFFORT_SMALL"><CODE>NN_EFFORT_SMALL</CODE> </a></th> 843 <td align="left"> 844 This macro is defined when making builds using the "<CODE>small</CODE>" optimization type. <BR><BR> 845 </td> 846 </tr> 847 <tr> 848 <th align="left"><a name="NN_SWITCH_DISABLE_DEBUG_PRINT"><CODE>NN_SWITCH_DISABLE_DEBUG_PRINT</CODE> </a></th> 849 <td align="left"> 850 This macro is defined when making builds using the <CODE>Release</CODE> build type if <CODE>false</CODE> has been specified for <a href="#DEBUG_PRINT"><CODE>DEBUG_PRINT</CODE></a>, or if <a href="#DEBUG_PRINT"><CODE>DEBUG_PRINT</CODE></a> has not been specified. 851 </td> 852 </tr> 853 <tr> 854 <th align="left"><a name="NN_SWITCH_DISABLE_ASSERT_WARNING"><CODE>NN_SWITCH_DISABLE_ASSERT_WARNING</CODE> </a></th> 855 <td align="left"> 856 This macro is defined when making builds using the <CODE>Release</CODE> build type if <CODE>false</CODE> has been specified for <a href="#ASSERT_WARNING"><CODE>ASSERT_WARNING</CODE></a>, or if <a href="#ASSERT_WARNING"><CODE>ASSERT_WARNING</CODE></a> has not been specified. 857 </td> 858 </tr> 859 </tbody> 860</table> 861<br/> 862 863<h2>4. <a name="omakefile"><CODE>OMakefile</CODE></a></h2> 864Normally, projects that use <CODE>OMake</CODE> have an <CODE>OMakefile</CODE> in each directory and <CODE>OMakeroot</CODE> 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 approach is also 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 <CODE>OMakefile</CODE> files include <CODE>modulerules</CODE> (build rules), while <CODE>OMakeroot</CODE> 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/> Start by describing the minimum settings needed to build an application. 865<h3>4.1 <a name="must_setting">Required Settings for Creating Applications</a></h3> 866Required 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> 867<pre> 868SUPPORTED_TARGETS = CTR-TS.Process.MPCore.* # Target both fast and small builds. 869 870SOURCES[] = main.cpp # Build the source file "main.cpp." 871 872TARGET_PROGRAM = test # The name of the image to generate is "test." 873 874 875#---- In general, do not change the following line unless you want to define your own build rules. 876include $(ROOT_OMAKE)/modulerules # Include modulerules. 877 878build: $(DEFAULT_TARGETS) # Configure the rule to run when building. 879</pre><br/> 880<h3>4.2 <a name="various_setting">Settings for Specific Uses</a></h3> 881This section describes how to write an <CODE>OMakefile</CODE>. It is based on a specific real-world 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/> 882<h4>■<a name="master_setting">Settings Required to Create Applications for Master Submission</a></h4> 883Required 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> 884<pre> 885#---- TITLE and ROMFS_ROOT can also be specified in the RSF file. 886TITLE = CtrApp # Specify the title of the application. 887ROMFS_ROOT = ./romfs # Specify the ROMFS root path. 888 889#---- CTR_BANNER and CTR_ICON can also be specified in the BSF file using CTR_BANNER_SPEC. 890CTR_BANNER = $(CTRSDK_ROOT)/resources/banner/Default.bnr # Specify the banner file. 891CTR_ICON = $(CTRSDK_ROOT)/resources/banner/Default.icn # Specify the icon file. 892 893 894ROM_SPEC_FILE = $(CTRSDK_ROOT)/resources/specfiles/Application.rsf # Specify the RSF file. 895DESCRIPTOR = $(CTRSDK_ROOT)/resources/specfiles/Application.desc # Specify the DESC file. 896</pre> 897<h4>■<a name="dlp_setting">Settings Required to Create Applications for Download Play</a></h4> 898Required 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 899<pre> 900CHILD_APPS[] = ../Child/images/CTR-TS.Process.MPCore.fast/Release/Child.cia # Specify child programs. 901</pre> 902Child 903<pre> 904CTR_APPTYPE = NAND 905CTR_ICON = Child.icn # Specify the child icon. 906 907ROM_SPEC_FILE = Child.rsf # Specify UniqueId and ChildIndex in the child RSF file. 908DESCRIPTOR = $(CTRSDK_ROOT)/resources/specfiles/DlpChild.desc # Specify the DESC file for the children. 909</pre> 910<h4>■<a name="sdapi_setting">Settings Required to Create Downloadable Applications</a></h4> 911Required variables: <CODE><a href="#CTR_APPTYPE">CTR_APPTYPE</a></CODE>, <CODE><a href="#MANUAL_DIR">MANUAL_DIR</a></CODE> 912<pre> 913CTR_APPTYPE = SD 914MANUAL_DIR = ./manual # Specify the directory where the e-manual is stored. 915</pre> 916<h4>■<a name="buildtype_setting">Branching Conditions by Build Type</a></h4> 917Required variables: <CODE><a href="#TARGET_BUILDTYPES">TARGET_BUILDTYPES</a></CODE><br/><br/>The following example illustrates how to create a <CODE>Release</CODE> build only in the "<CODE>test</CODE>" directory. <br/> 918<pre> 919if $(equal $(filter Release,$(TARGET_BUILDTYPES)),Release) 920 .SUBDIRS: $(exist-dirs test) 921</pre> 922 923 <hr><p>CTR-06-0205-002-J<br>CONFIDENTIAL</p></body> 924</html>