Site Tools


documentation:development:opera:pf25:ppgfldr:smmfldr:gspfldr:01pgs002

Preparing a Program


Preparing a program for the first time involves two steps discussed in this section:

For More Information

More information about the ARM compiler, linker and assembler is in 3DO Tools for Programming III (blue cover). For optimizing your code, pay special attention to the “ARM Cookbook” in that volume.

Creating a Makefile Using Create3DOMake

The Create3DOMake MPW tool creates a simple makefile for building a 3DO program. After you've installed the 3DO software from the installation disc and have moved the Userstartup3DO file into your MPW folder, a 3DO menu becomes available from MPW.

When you select the Create 3DO Makefile command in the 3DO menu, a dialog appears that lets you define the makefile. As you specify options, a Command Line section in the dialog is filled in.

The program for which you create the makefile may be written in any combination of Assembly Language, C, C++, or Rez. When you run the makefile, it will copy the successfully built program to the {3DORemote} folder. If you checked “Symbolic debugger information,” the makefile also copies the symbol file to the {3DORemote} folder.

After the tool is installed, you can use it from the command line or via the graphical user interface as follows:

<HTML><ol></HTML> <HTML><li></HTML><HTML><p></HTML>From the 3DO menu in MPW, select Create 3DO Makefile. A dialog lets you choose options for the program:<HTML></p></HTML> <HTML><p></HTML>Graphic cannot be displayed<HTML></p></HTML> <HTML><p></HTML>Figure 1: Create3DO Make dialog.<HTML></p></HTML><HTML></li></HTML> <HTML><li></HTML>Provide the program name (name of the executable), for example UFO.<HTML></li></HTML> <HTML><li></HTML>Click the Source Files button.<HTML></li></HTML> <HTML><li></HTML><HTML><p></HTML>In the file selection dialog that appears, select your source files.<HTML></p></HTML> <HTML><p></HTML>The program name and one source file are the only obligatory arguments.<HTML></p></HTML><HTML></li></HTML> <HTML><li></HTML><HTML><p></HTML>Check the boxes for additional options as follows:<HTML></p></HTML> <HTML><ul></HTML> <HTML><li></HTML>“Include streaming libraries” includes references to the DataStreamer libraries in the makefile. Check this box if you use DataStreamer calls.<HTML></li></HTML> <HTML><li></HTML>“Create source directory script,” creates a .spt file that can be used by the 3DO Debugger to find source directory information.<HTML></li></HTML> <HTML><li></HTML>“Symbolic debugger information” writes a makefile that generates a symbols file you can use for debugging source code.<HTML></li></HTML><HTML></ul></HTML>

<HTML><p></HTML>
<HTML></p></HTML> <HTML><p></HTML>Caution: The options “Include 3D libraries and “Enable memory leaks detection” are currently not valid.
<HTML></p></HTML> <HTML><p></HTML>As you enter the information, the Command Line section is updated accordingly. The illustration below shows a completed dialog box for creating a program named UFO that includes symbolic debugging information but none of the other options.<HTML></p></HTML> <HTML><p></HTML>Graphic cannot be displayed<HTML></p></HTML> <HTML><p></HTML>Figure 2: Create3DOMake example<HTML></p></HTML><HTML></li></HTML> <HTML><li></HTML><HTML><p></HTML>When you've selected all desired options, choose the Create3DOMake button and the script builds a makefile.<HTML></p></HTML> <HTML><p></HTML>Note: In case of complex dependencies among header files, use the makefile created by Create3DOMake as a starting point, then add special dependencies in the appropriate section.<HTML></p></HTML><HTML></li></HTML><HTML></ol></HTML>

Building the Program

Use the following procedure to build the program:

  1. Place all source and data files and the makefile in the same folder.
  2. From the Directory menu in MPW, choose Set Directory to set the folder that contains the makefile and source files for the next build. If you're currently in the directory, choose “Select Current Directory.”
  3. From the Build menu, choose Build (or Full Build).
    • Build rebuilds the program taking into account sources that changed.
    • Full Build rebuilds everything, regardless of changes.
  4. Enter the name of the executable, as specified in the makefile, when prompted.

MPW compiles and links the program, using the commands in the makefile. If you're using a makefile generated by Create3DOMake, a copy of the executable and of the .sym file-if “Symbolic debugger information” was selected-are placed into $boot. The $boot variable evaluates to /remote or /cd-rom.

After MPW has created the executables, you can test the program on the 3DO system using the 3DO Debugger as your interface to the 3DO hardware. For more information, see the 3DO Debugger Programmer's Guide in the volume “3DO Tools for Programming I” that is part of the Toolkit documentation set (blue cover).

If compilation does not work, you need to resolve the error messages provided in the MPW worksheet.

documentation/development/opera/pf25/ppgfldr/smmfldr/gspfldr/01pgs002.txt · Last modified: 2022/10/10 16:53 by 127.0.0.1