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:

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:

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++