Share via


Create a Project in the Development Environment That Can Be Built with NMAKE

There are two ways to export a makefile from the development environment. You can choose to export a makefile whenever you save a project, or export a makefile only for specific projects. Note that creating an export makefile increases project save time, and you should only do it when necessary.

The export makefile stores all the information required to build the project and can be used from the command line. The makefile specifies the same project build settings you set in the development environment. If you use NMAKE on the command line to build the project, the NMAKE syntax needed is given in the makefile as a comment that begins !MESSAGE NMAKE. For example, for a file test.mak the NMAKE syntax line is:

!MESSAGE NMAKE /f "test.mak" CFG="test - Win32 Debug"

To export an NMAKE makefile whenever you save a project

  1. From the Tools menu, click Options.

    The Options dialog box appears.

  2. On the Options dialog box, click the Build tab.

  3. Select the Always export makefile when saving project option.

  4. Click OK.

To export an NMAKE makefile for a particular project

  1. Open the project.

  2. From the Project menu, click Export Makefile.

    A .MAK file with the project name is immediately created and saved to the project directory.