SYNTAX
CreateMake programName sourceFile…
[libraryFile…] [objectFile…] [resourceFile…]
[-app[lication] | -cr | -shrlib | -siow | -staticlib | -tool]
[-68k | -powerpc | -fat] [-AOptions options] [-c creator] [-carbon]
[-COptions options] [-CPlusOptions options] [-depends] [-exceptions]
[-export exportSymbol] [-i includePath] [-LinkOptions options]
[-m mainEntryPoint] [-mc68020] [-mc68881 | -elems881] [-minSize n]
[-model near | far | cfm68k] [-noCarbRsrc] [-noSizeRsrc]
[-objdir dirName] [-opt default | none | size | speed]
[-POptions options] [-ppcAOptions options] [-ppcCOptions options]
[-ppcCPlusOptions options] [-ppcLinkOptions options]
[-ppcPOptions options] [-prefSize n] [-procinfo n] [-ra resAttributes]
[-rawpef] [-rn resName] [-rt resType=ID] [-sizeRsrcBits n] [-sym]
[-t fileType] [-x]
DESCRIPTION
The CreateMake tool creates a simple makefile for building an application, an MPW tool, a shared library, a static library, or a stand-alone code resource.
You can build programs to run on 68K or PowerPC machines or both (i.e., "fat" applications).
You use the CreateMake options to indicate the type of item you are building, the target machine type,
as well as several other details about your program. You can also specify additional options to be
passed along to the assemblers, compilers, and linkers.
Using the list of input files and the specified options, CreateMake generates build commands and
writes them to the makefile named programName.make.
The BuildProgram command uses this makefile to build your program.
For each source file, CreateMake uses the filename suffix to establish its programming language.
The recognized filename extensions are defined in the 'xMap'(128) resource
within the CreateMake tool. You can edit this resource if you wish to change the recognized filename extensions.
The format of the 'xMap' resource is shown below.
/* filename extensions -> languages */
type 'xMap'
{
byte = $$CountOf(ExtensionArray);
array ExtensionArray
{
byte AsmExtension = 1,
CExtension = 2,
CPlusExtension = 3,
PascalExtension = 4,
RezExtension = 5;
cstring;
};
};
The 'xMap' resource currently defines the following source file extensions:
Language
|
Extensions
|
Assembly
C
C++
Pascal
Rez
|
.a
.c
.cp
.p
.r
|
.asm
.cpp
.pas
.rez
|
.s
.cc
|
.cxx
|
In addition to source files, you can also list object files, static libraries, stub libraries, shared libraries, and resource files.
CreateMake identifies object files and libraries by their Finder file type. Resource files must have
the filename extension ".rsrc" in order to be recognized by CreateMake.
Note
CreateMake automatically includes the standard MPW library files, such as StdCLib and PPCCRuntime.o, in the generated link command.
Therefore, it is not necessary to specify these files as parameters to CreateMake.
•
INPUT
None
OUTPUT
A makefile containing the build commands for your program. The makefile is named programName.make
unless the -x option is specified, in which case, it is named Makefile.
STATUS
CreateMake can return the following status codes:
0
|
no errors
|
1
|
parameter or option error
|
PARAMETERS
programName
Specifies the program name.
sourceFile…
Specifies your program's source files. You must specify at least one source file.
Source files can be written in any combination of assembly language, C, C++, Pascal, and Rez.
libraryFile…
Specifies additional static libraries, stub libraries and/or shared libraries that should be
included in the link command for your program. Note that CreateMake automatically includes the
standard MPW library files, such as StdCLib and PPCCRuntime.o, in the generated link command.
Therefore, it is not necessary to specify these files as parameters to CreateMake.
objectFile…
Specifies additional object files that should be included in the link command for your program.
resourceFile…
Specifies one or more resource files (i.e. pre-compiled resources) that should be included in your program. Note that
resource files must have the filename extension ".rsrc" in order to be recognized by CreateMake.
OPTIONS
-app[lication] | -cr | -shrlib | -siow | -staticlib | -tool
Specifies the program type.
-app[lication]
Creates build commands for an application. Applications can be run from the Finder or the MPW Shell.
-cr
Creates build commands for a stand-alone code resource.
-shrlib
Creates build commands for a shared library.
-siow
Creates build commands for a Simple Input/Output Window application.
The SIOW package enables your program to interact with the user through a simple window.
-staticlib
Creates build commands for a static (i.e. link-time) library.
-tool
Creates build commands for an MPW tool. Tools must be run within the MPW Shell environment.
-68k | -powerpc | -fat
Specifies the target machine type.
-68k
Specifies a 68K machine as the target.
-powerpc
Specifies a PowerPC machine as the target.
-fat
Specifies both 68K and PowerPC machines as the target.
Note
Stand-alone code resources and static libraries cannot be "fat".
•
-AOptions options
Specifies additional 68K assembler options.
-c creator
Specifies the program's creator. The default creators are as follows:
|
Program Type
|
File Type
|
application
|
'????'
|
code resource
|
'????'
|
shared library
|
'????'
|
SIOW application
|
'siow'
|
static library
|
'MPS '
|
MPW tool
|
'MPS '
|
-carbon
Specifies the Carbon PowerPC runtime environment. CreateMake can create makefiles for
Carbon applications, Carbon shared libraries, and Carbon static libraries.
For Carbon applications, the generated makefile will contain build rules that create the required
'carb'(0) and 'SIZE'(-1) resources.
This behavior can be disabled by specifying the -noCarbRsrc and/or
-noSizeRsrc options. The default 'SIZE'(-1)
resource will have the minimum and preferred memory sizes set to 1 MB, and the flag bits set to
$58C0. These values can be changed using the
-minSize, -prefSize, and -sizeRsrcBits options.
-COptions options
Specifies additional 68K C compiler options.
-CPlusOptions options
Specifies additional 68K C++ compiler options.
-depends
Uses the MakeDepend tool to generate include file dependencies.
-exceptions
Enables C++ exception handling.
Note
In order to run a PowerPC program that uses C++ exceptions, the MrCExceptionsLib shared library
must be available at runtime.
•
-export exportSymbol
Specifies a symbol that should be exported when building a shared library. This option must appear once for each exported symbol.
-i includePath
Specifies a directory that should be searched by the compilers and assemblers when looking for "include" files.
You can place up to 128 -i
options, not exceeding 2048 characters, on a single command line.
-LinkOptions options
Specifies additional 68K linker options.
-m mainEntryPoint
Specifies the main entry point. This option is required when building a stand-alone code resource.
-mc68020
Specifies that the 68K Pascal and C compilers should generate MC68020 instructions where applicable.
-mc68881 | -elems881
Specifies that the 68K Pascal and C compilers should generate MC68881 math coprocessor instructions.
-mc68881
Specifies that the 68K Pascal and C compilers should generate MC68881 math coprocessor instructions
for the basic operations:
+, -, *, ÷, conversion between binary formats, and comparison. The SANE library
functions will be used for transcendentals.
-elems881
Specifies that the 68K Pascal and C compilers should generate MC68881 math coprocessor instructions
for the basic operations (see -mc68881) as well as for transcendental functions.
-minSize n
Specifies the minimum memory size in K for a Carbon application. This information is used when
generating the 'SIZE'(-1) resource. The default minimum memory size is 1 MB.
-model near | far | cfm68k
Specifies the 68K runtime model when building a 68K (or fat) program.
near
Generates a classic 680x0 runtime output file with 16-bit references to code and data.
Note
68K code resources must use -model near.
•
far
Generates a classic 680x0 runtime output file with 32-bit references to code and data.
cfm68k
Generates a CFM-68K runtime output file.
Note
68K shared libraries must use -model cfm68k.
•
-noCarbRsrc
Specifies that a 'carb'(0) resource should not be automatically generated when building a Carbon application.
-noSizeRsrc
Specifies that a 'SIZE'(-1) resource should not be automatically generated when building a Carbon application.
-objdir dirName
Specifies the directory where the object files will be located. The default is to use the "current" directory.
-opt default | none | size | speed
Controls the level of optimization performed by the C and C++ compilers.
default
Turns on the default C/C++ compiler optimizations.
none
Turns off all C/C++ compiler optimizations.
size
Turns on optimizations across basic blocks that decrease code size.
These can take more compilation time and memory. They include global
constant propagation, loop optimizations, and redundant store & common
expression reduction.
speed
Turns on additional optimizations that may make the code larger but
faster. These can take a lot of time and memory to perform.
They include loop unrolling and additional register
optimizations for non-leaf functions.
-POptions options
Specifies additional 68K Pascal compiler options.
-ppcAOptions options
Specifies additional PowerPC assembler options.
-ppcCOptions options
Specifies additional PowerPC C compiler options.
-ppcCPlusOptions options
Specifies additional PowerPC C++ compiler options.
-ppcLinkOptions options
Specifies additional PowerPC linker options.
-ppcPOptions options
Specifies additional PowerPC Pascal compiler options.
-prefSize n
Specifies the preferred memory size in K for a Carbon application. This information is used when
generating the 'SIZE'(-1) resource. The default preferred memory size is 1 MB.
-procinfo n
Specifies the value that should be stored in the procInfo field
of the routine descriptor when building a PowerPC code resource. The default value is 1.
This option is ignored for 68K code resources.
-ra resAttributes
Specifies the resource attributes when building a stand-alone code resource.
The attributes are specified as a list of comma-separated keywords or decimal or hexadecimal numbers.
A list of attributes and their corresponding decimal and hexadecimal values follows.
(Note that you can omit the initial res for resource attributes.)
|
Resource attributes
|
Decimal
values
|
Hexadecimal
values
|
resSysHeap
|
64
|
$40
|
resPurgeable
|
32
|
$20
|
resLocked
|
16
|
$10
|
resProtected
|
8
|
$08
|
resPreload
|
4
|
$04
|
resChanged
|
2
|
$02
|
-rawpef
Creates a "raw PEF" PowerPC code resource. The resource will consist of the
PEF container only and will not begin with a routine descriptor.
This option is ignored for 68K code resources.
-rn resName
Specifies the resource name when building a stand-alone code resource.
-rt resType=ID
Specifies the resource type and ID when building a stand-alone code resource.
This option is required when building a code resource.
-sizeRsrcBits n
Specifies the 'SIZE'(-1) resource bits for a Carbon application. This
information is used when generating the 'SIZE'(-1) resource. By default,
the flag bits are set to $58C0.
-sym
Creates build commands that generate symbolic debugging information.
-t fileType
Specifies the program's file type. The default file types are as follows:
|
Program Type
|
File Type
|
application
|
'APPL'
|
code resource
|
'????'
|
shared library
|
'shlb'
|
SIOW application
|
'APPL'
|
68K static library
|
'OBJ '
|
PowerPC static library
|
'XCOF'
|
MPW tool
|
'MPST'
|
-x
Names the generated makefile Makefile instead of programName.make.
EXAMPLES
The following command line creates the Count.make
makefile containing commands for building the Count
MPW tool from the Count.c
and Count.r
source files.
CreateMake Count count.c count.r -tool -fat
SEE ALSO
BuildMenu
BuildProgram
Copyright Apple Computer, Inc. 1993-2001
Last Updated June 2001
|
|