Program-wide Analysis and Optimization
4-9
4
The appropriate location for the PDB directory is probably in the directory
where the makefile compiles and links the object modules. For example,
the UNIX and Windows statements below are suitable for many users.
setenv I960PDB ./pdb (UNIX)
set I960PDB ./pdb (Windows)
Replacing Optimization Options with
fdb and gcdm
Except for the definition of the
OPT macro, the example is typical of
simple makefiles that use ordinary optimizations. From the point of view
of the makefile and/or the build system, the
fdb option combined with one
or more
gcdm options is often a direct replacement for ordinary
optimization options such as
O, because the compilation tools that accept
ordinary optimization options also accept program-wide optimization
options.
Programs linked by direct invocation of the linker are exceptions to this
general rule. In such a case, the
gcdm option must be added to the linker
invocation.
Using Linker Invocations with gcdm for Automatic
Management of Object Files at Link Time
The example makefile always produces a program load module with the
same name. Since the options provided when the make tool is invoked
affect the linked program when there have been no apparent changes to
the source or object files, the makefile uses an artificial
force dependence
to guarantee that the program is linked at every invocation of make. This
is a common practice, and keeps the makefile simple.
You could instead write the makefile so that different options to the link
step produce program load modules with different names. The artificial
force dependency could then be removed, perhaps saving an occasional
unnecessary linker invocation. However, in the program-wide
optimization system there is no more reason to try to eliminate extra linker
invocations than there would be in an ordinary system. In fact, the
development environment can often be simplified by forcing linker
invocations (as in the example makefile) for the following reasons: