Previous Book Contents Book Index Next

Inside Macintosh: Programmer's Guide to MacApp / Part 2 - Working With MacApp
Appendix A - Working With the MacApp Build System


Outputs

The MABuild process creates a makefile called YourApp.MakeIt. It also creates object files for your code and for MacApp's code, an executable version of your application, and a folder in which the other files are stored.

The YourApp.MakeIt script contains the commands that were executed by the build. You should not simply execute this file again when you need to rebuild. Instead, run MABuild again so it can determine what must be rebuilt.

Folder-Naming Convention

Where does MABuild put all the files it generates? It puts the file YourApp.MakeIt (containing the output of the MABuild process), along with the object code files, executable application file, and symbol file (if any), in a folder in the directory specified by the options in the MABuild command. This folder is normally a subdirectory of the application's source code folder.

If you use the -autoBuild option to build MacApp along with your application, MABuild creates a similarly named library folder for each variation of MacApp in MacApp's library directory, referred to by the shell variable {MALibraries}.

MacApp has many compile-time variables that you can set with MABuild's flag options. By default, MABuild creates a separate folder named after the options you choose, prepended by a character determined by the MPW shell variable MASeparateObjectsPrefix. For example, if you specify the options -nodebug, -sym, the output goes in a folder named (depending on the character specified by MASeparateObjectsPrefix)

%S7TeSmClSC

MABuild names the folders in which it keeps these separate versions using a convention that assigns a two-character mnemonic based on the value of each compile-time flag, as shown in Table A-3. Then it strings together all the pairs to produce one long name.

The name constructed from the string of mnemonic pairs indicates exactly what's in the folder, but it's not easily parsed by human eyes. MABuild offers an option (the RenameFlag option) that lets you give any name you like to any set of flags. In fact, the file {MATools}MABuild.r defines remappings for many sets of sets of flags, including those shown in Table A-4. As a result, for the options -nodebug, -sym, the real name of the output folder is (depending on the character specified by MASeparateObjectsPrefix)

%68K Sym

You can define other names using the RenameFlag option on the MABuild command line. Or you can modify the definition of MABuildDefaults in the 1Startup file by adding lines such as the following (a made-up example, which remaps S7CqTeMr to NoDebug MrC Special instead of NoDebug MrC):

-RenameFlag S7CqTeMr 'NoDebug MrC Special'

You can also modify the 'STR#'(1000) RenameFlags resource in the MABuild tool. This is more efficient than adding rename flags in MABuildDefaults or on the command line.
Table A-3 Compiler option mnemonics
CodeMnemonic forCompiler option flag
20Requires 68020 CPUqNeedsMC68020
30Requires 68030 CPUqNeedsMC68030
40Requires 68040 CPUqNeedsMC68040
CFRequires Code Fragment ManagerqModelCFM
ClRequires classic 68K runtime supportqClassic
CqRequires Color QuickDrawqNeedsColorQD
DbBasic debugging supportqDebug
DmTurn on debugging messagesqDebugMsg
fCfDFar code and data modelsqModelFarData,
qModelFarCode
FpRequire 68881 or 68882 coprocessorqNeedsFPU
InInspector window supportqInspector
 
JSupport for Jasik's debuggerqTheDebugger
M8Build with Metrowerks C/C++ compiler for 68KNo flag defined by MacApp; define __MWERKS__ in your code
MrBuild with MrC compilerNo flag defined by MacApp
MWBuild with Metrowerks C/C++ compiler for Power MacintoshNo flag defined by MacApp; define __MWERKS__ in your code
PePerformance monitoring supportqPerform
RaDo range checkingqRangeCheck
S7Requires System 7 or laterSystemSevenOrLater
SCBuild with Symantec C++ compiler (SCpp)No flag defined by MacApp
SmSADE and SourceBug support qSym
TeTemplate views supportqTemplateViews
VuRequires Virtual User supportqNeedsVU
WrWriting template views supportqWriteTemplateViews

You don't normally change the default setting for the SeparateObjects option, but if for some reason you do not want to keep separate builds in separate folders, you can specify -NoSeparateObjects on the MABuild command line.
Table A-4 MABuild remapped names
Compiler mnemonicNew (remapped) name
S7CqTeMrMrC
S7CqTeSmMrMrC Sym
S7TeSmClSC68K Sym
S7CqDbDmRaTeSmMrMrC Debug
S7NmDbDmPeRaTeSmfCfDClSC68K Debug Far


Previous Book Contents Book Index Next

© Apple Computer, Inc.
25 JUL 1996