Use Makefiles as Sources for a Build
You can process a makefile during a VisualAge C++ build, by
supplying a makefile as a source in your configuration
file. The build process runs the make utility implicitly to
process the makefile before the compile and link
is performed. Typically, you do this to set up the
environment at the start of the build process or to run tools
that are not integrated into the IDE.
Supply a makefile as a source for a build to run the make
utility as a build extension of the VisualAge C++ build
process. A source file is recognized as a makefile if
it has the file extension .mak or is qualified by a type(mak) clause. Because it
is a build extension, the way you specify options for the make utility
is different from other processes that run during a build.
You can use the following configuration file options to control
how the make utility is run when processing makefiles during a
build:
- make_name ( string )
The string contains the make utility executable's name.
The
default executable name for the make utility on AIX is make.

The
default executable name for the make utility on OS/2 and Windows NT
is nmake.
- make_preopt ( string )
The string contains any command line options that you
would place before the makefile name if you were running
the make utility from the command line. Do not include
the /f option, because it is added automatically before
the makefile name when the make utility is invoked. The
make utility will fail if this option is specified twice.
- make_postopt ( string )
The string contains any command line options that you
would place after the makefile name if you were running
the make utility from the command line.
The makefile itself is exactly like a makefile you use when
you run the make utility from the command line.
Processing makefiles during a build has some limitations:
- Since the /f option is added automatically to the
invocation command to specify the name of the makefile to
the make utility, any make utility that does not support
this option will not work with this build extension.
- You cannot run the make utility as a
build extension after or at the same time as the compile and
link. However you can use the run directive to start the
make utility as a command line program.
- The build process cannot test time stamps on files named
inside the makefile. It always runs the make utility,
regardless whether all files are up to date.
- Do not use the /q option. When run with the /q option,
the make utility returns zero only if all targets are up
to date and returns a nonzero value otherwise. The build
process interprets a nonzero return value as a failure
code and terminates your build.
- Output that displays to the standard output stream,
stdout, is not visible. You can redirect the streams by
adding the redirection characters to the end of the
string you supply for option make_postopt, as in the
example below. Errors will be available, however.
- Any settings made to environment variables from the
makefile are lost when the make utility ends. If you want
to use makefiles to set up your environment, you should
start the build from the makefile, by running the vacbld
command from the makefile.
Here is an excerpt from a configuration file that runs the
make utility on a file called makefile:
option make_name( "mymake" )
make_preopt( "/a"),
make_postopt("/nologo > make.out") {
source type(mak) makefile
}
In this example, the type clause is required in the source directive because the
makefile does not have an extension. You can omit this clause if
the source file has the file extension .mak. Two command line
arguments, /a and /nologo, are specified and output to stdout is
redirected to the file make.out.
The effect of the example is equivalent to entering the
following line on the command line:
mymake /a /f makefile /nologo > make.out

Configuration Files
When to Use Makefiles
Makefiles
Build Extensions and Extension
Specification Files
Standard
Streams

Build
Run the Make
Utility
Make Utility
Command Options
Redirect Standard
Streams

Build Extensions Supplied with
VisualAge C++