Revolution Build System Revolution SDK
Total Page:16
File Type:pdf, Size:1020Kb
Revolution Build System Version 1.03 The contents in this document are highly confidential and should be handled accordingly. © 2006-2007 Nintendo RVL-06-0044-001-E CONFIDENTIAL Released: October 22, 2007 Revolution Build System Revolution SDK Confidential These coded instructions, st atements , and computer programs contain proprieta ry information of Nintendo of America Inc. and/or Nintendo Company Ltd. and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. RVL-06-0044-001-E 2 © 2006-2007 Nintendo Released: October 22, 2007 CONFIDENTIAL Revolution SDK Revolution Build System Contents 1 Overview ................................................................................................................................ ....... 6 2 Assumptions ................................................................................................................................ .7 3 Running Demos ............................................................................................................................ 8 3.1 Initializing the Revolution Shell ........................................................................................... 8 3.2 Running a Demo from the Command Line ......................................................................... 8 3.3 Running a Demo from the Debugger .................................................................................. 8 4 Building a Sample Application ...................................................................................................... 9 4.1 Platforms ............................................................................................................................. 9 4.2 DEBUG and NonDebug Builds ........................................................................................... 9 4.3 Cleaning ............................................................................................................................ 10 4.4 Building Projects ............................................................................................................... 10 4.5 Building Individual Executables ........................................................................................ 10 4.6 Adding Files ...................................................................................................................... 11 4.7 Creating Your Own Modules ............................................................................................. 11 5 Build Tree Overview ................................................................................................................... 13 5.1 Interfaces .......................................................................................................................... 14 5.2 Building Projects ............................................................................................................... 15 5.2.1 Naming Rules for Binary Files ................................................................................. 15 5.3 Source Code ..................................................................................................................... 16 5.4 Demo Modules .................................................................................................................. 17 6 Compiler ................................................................................................................................ ..... 18 6.1 Overview ........................................................................................................................... 18 6.2 CodeWarrior Setup ........................................................................................................... 18 7 Building the Libraries and Demos ............................................................................................... 19 7.1 Build Environment ............................................................................................................. 19 7.2 Running Make ................................................................................................................... 19 7.3 Targets for DEBUG and Non-Debug (Optimized) Versions .............................................. 19 7.4 Building a Given Binary File .............................................................................................. 20 7.5 Deleting Binaries ............................................................................................................... 20 7.6 Disassembly ..................................................................................................................... 20 8 Running Applications .................................................................................................................. 21 8.1 Workflow of the Edit-Debug Cycle .................................................................................... 21 9 Makefile Operation ..................................................................................................................... 22 9.1 Overview ........................................................................................................................... 22 9.1.1 Paths ....................................................................................................................... 22 9.2 Makefiles for Modules ....................................................................................................... 22 9.2.1 Specifying Libraries to Build .................................................................................... 23 9.2.2 Specifying Executable Programs to Build ............................................................... 24 10 Adding Your Own Modules ......................................................................................................... 25 11 Common Problems ..................................................................................................................... 26 11.1 Sizes of Custom Data Structures and the SDK Library Do Not Match ............................. 26 11.2 A “‘_main’ not found” Error Occurs During Linking ........................................................... 26 11.3 Make Indicates ".o" Files Cannot Be Found yet It Runs The Second Time Around ......... 26 11.4 The Make Clobber Command Hangs When Deleting bin/RVL/* ...................................... 26 11.5 The Debugger Won't Stop At the Main Function .............................................................. 26 11.6 Breakpoints Cannot Be Set In the Debugger .................................................................... 26 Appendix A. Operation of commondefs and modulerules .................................................................. 27 A.1 Note ................................................................................................................................ .. 27 A.2 commondefs Conventions ................................................................................................ 27 A.3 commondefs ..................................................................................................................... 27 A.4 EPPC-Specific Flags ........................................................................................................ 30 A.5 Debug Flags ..................................................................................................................... 32 A.6 modulerules ...................................................................................................................... 32 © 2006-2007 Nintendo 3 RVL-06-0044-001-E CONFIDENTIAL Released: October 22, 2007 Revolution Build System Revolution SDK A.7 Path Setup ........................................................................................................................ 32 A.8 Building Objects ................................................................................................................ 33 A.9 Generating Dependencies ................................................................................................ 35 A.10 Object Header Rules ........................................................................................................ 35 A.11 Linking .............................................................................................................................. 36 Appendix B. How to Boot NDEV ........................................................................................................ 37 Code Examples Code 9–1 Makefile Header ............................................................................................................. 23 Code 9–2 Library Build Variables ................................................................................................... 23 Code 9–3 Build Variables for Executable Programs ....................................................................... 24 Code 9–4 Make Rule Format used to Specify Objects to Link with Executable Programs ............. 24 Code 10–1 Adding a Build Tree to modulerules ............................................................................. 25 Code 10–2 Editing the makefile of the Local Module ...................................................................... 25 Code A–1 ROOT ............................................................................................................................. 28 Code A–2 ARCH_TARGET and PLATFORM ................................................................................