Files in a Project

When you create a project, the Microsoft visual development environment always creates the following files:

File Extension Description
Project workspace file .DSW Stores project workspace information.
Project file .DSP Used to build a single project or subproject.
Workspace options file .OPT Contains environment settings for Visual Fortran, such as window sizes and positions, insertion point locations, state of project breakpoints, contents of the Watch window, and so on.

Directly modifying the .DSW and .DSP files with a text editor is not supported.

For information on creating (exporting) a makefile, see The Project Makefile.

When you create a project, you also identify a project subdirectory. If the subdirectory does not exist, the visual development environment creates it. Project files that the visual development environment creates are put into this directory.

When you create a project, the visual development environment also specifies subdirectories for intermediate and final output files for the various configurations that you specify. These subdirectories allow you to build configurations without overwriting intermediate and final output files with the same names. The General tab in the Project Settings dialog box lets you modify the subdirectories, if you choose.

If you have existing source code, you should organize it into directories before building a project, although it is easy to move files and edit your project definitions if you should later decide to reorganize your files.

If your program uses modules, you do not need to explicitly add them to your project, they appear as dependencies (.mod files).

For a newly created project (before you request a Update Dependencies), the visual development environment scans the file list for modules and compiles them before program units that use them. The visual development environment automatically scans the added project files recursively for modules specified in USE statements, as well as any INCLUDE statements. It scans both source files (.FOR, .F, .F90) and the resource file (.RC), and adds all the files it finds to a Dependencies folder. You cannot directly add or delete the files listed in this folder.

Module files are a precompiled, binary version of a source file, stored as a .mod file. When you change the source definition of a module, you can update the .mod file before you rebuild your project by compiling that source file separately by clicking (selecting) the file in the FileView pane and select Compile from the Build menu.

To control the placement of module files in directories, use the /[no]module compiler option.

To control the search for module files in directories, use the /[no]include and the /assume:source_include compiler options.

The Project Makefile

The visual development environment speeds and simplifies the task of building programs and libraries outside of the visual development environment by allowing you to export a makefile, which is a set of build instructions for each project. Makefiles contain the names of the source, object, and library files needed to build a program or library, plus the compiler and linker options selected in the Project Settings dialog boxes.

The visual development environment updates the build instructions in internal makefiles when you add or remove project files in the project window, and when you make changes to the compiler or linker options in the Project Settings dialog boxes. To get an updated version of a makefile, update project dependencies (use the Build menu) and from the Project menu, select Export Makefile. The makefile is used by the external program maintenance utility, NMAKE.EXE.

You can edit the makefile generated by the visual development environment if you need to perform unusual or exceptional builds. Remember, however, that once you have edited a makefile, exporting the makefile again from the visual development environment will overwrite your changes.

If you use a foreign makefile for a project, the visual development environment calls NMAKE to perform the build. You can run NMAKE from the console command line to perform builds either with makefiles exported by the visual development environment or with foreign makefiles that you have edited. For more about the external program maintenance utility, see Building Projects with NMAKE.


Note: When you use a foreign makefile, the project is considered to be foreign. You cannot use the Project Settings dialog box to make changes to the build options, or use the Add to Project dialog box to add files.