Important: The information in this document is obsolete and should not be used for new development.
Default Inputs Provided to MABuild
MABuild takes two sorts of inputs: the defaults provided to MABuild from various preexisting sources and the defaults you provide.MABuild uses the defaults written into its code and those provided by the definition of MPW shell variables in MacApp's
1Startup
file. For example, to build MacApp's own libraries MABuild uses MacApp's makefile, along with several partial makefiles, includingDefinitions_Common
,Definitions_68K
(Definitions_PPC
for a Power Macintosh build), andDependencies_68K
(orDependencies_PPC
). It also uses the source code files and resources that make up the MacApp libraries. A similar process is used to build your application.One-File Build Configuration
When your program is stored in one file--that is, your main program, interface, and implementation are all in the same program module--MABuild provides several defaults to make the build process work.In the absence of a resource definition file (YourApp
.r
), MABuild uses MacApp's default resource file,Defaults.r
, to build the application. This file includes resources to support all the building blocks (such asUDialog
andUPrinting
) and therefore may be larger than strictly necessary for your application. MABuild also uses the partial makefiles provided by MacApp to set default options for the build process.When all your code is in the main program module, you can use the simplest form of the MABuild command to build your application. Simply enter
MABuild
followed by a single parameter, the name of the application. To build a program named YourApp, you typeMABuild YourApp
in your MPW worksheet window and press the Enter key.MABuild
is the command, and YourApp is the name of the target application.
- Note
- If you use only the name of the application as the target parameter, be sure to set the MPW directory to the location of your source code before starting the build. Or you can prefix the target application name with the pathname of the source code directory.
MPW Shell Variables for MABuild
TheMABuild
script looks at a number of global MPW shell variables to determine default behavior for MABuild. These variables are set in MacApp's1Startup
file. Although you can modify any of these variables, comments in the startup file indicate certain variables you normally avoid changing. The following variables are ones you can safely change:
{MABuildDefaults}
You can change this variable to include the options you use most frequently when you call MABuild. When you want to use less frequently required options, you can either modify the definition for
MABuildDefaults
or specify the options on the command line. Options specified on the command line always override those supplied by MPW shell variables. See the startup file to see how these variables are originally configured.{MAUserAutoBuild}
This variable contains a list of targets you want always to be appended to any targets you include on the command line. (They are used only if the
AutoBuild
option is specified.) This is useful if you have added your own library of objects to MacApp's and want to make sure they are kept up to date. A drawback is that every time you build, some time will be lost checking to see whether these files need to be recompiled. If your library is not likely to change, you may be better off not using this option. This variable is empty by default.{MADone}
This variable specifies what MPW command should be executed if the build is successful. The default for this command is to play a high beep sound. You can modify it to run silently, as other MPW commands do, or to play or do something more interesting.
{MAFailed}
This variable specifies which MPW command should be executed if the build fails. The default for this command is to play a low beep sound. You may modify it to run silently, as other MPW commands do, or to play or do something really wacky.