Share via


Overview of MakeDirs

MakeDirs is a command-line tool that creates a Dirs file within each subtree of your project source tree.

When you run this utility, you specify the path of the project source tree from the command line, as shown in the following example:

Makedirs PathToProjectSourceTree

The MakeDirs utility performs a scan of the project source tree and does the following:

  • If the source tree contains only one leaf node and no subtrees, the utility does not create a Dirs file.

  • If the source tree contains multiple leaf nodes within a subtree, the utility creates a Dirs file in the root directory of the subtree. The Dirs file contains macro definitions that specify the name of the subdirectory of the leaf node within the subtree.

  • If the source tree contains multiple subtrees, with each subtree at the root of one or more leaf nodes, the utility creates a Dirs file in the root directory of each subtree. For each Dirs file, macro definitions specify the name of the subdirectory of the leaf node that is nested within the subtree.

The following figure shows a project source tree that contains multiple leaf nodes in one subtree. In this figure, the project source tree is MyProjectTree1.

Diagram illustrating a project source tree that contains multiple leaf nodes in one subtree

If you run Makedirs MyProjectTree1 from the command line, the utility scans the source tree and determines that there are multiple leaf nodes within a single subtree (MyProjectTree1). Therefore, the utility creates a Dirs file in the subtree, and this Dirs file specifies the three leaf nodes as shown in the previous figure.

The following figure shows a project source tree that contains multiple leaf nodes in two subtrees. In this figure, the project source tree is MyProjectTree2.

Diagram illustrating a project source tree that contains multiple leaf nodes in two subtrees

If you run Makedirs MyProjectTree2 from the command line, the utility scans the source tree and determines that there are two subtrees, and each subtree contains multiple leaf nodes. Therefore, the utility creates Dirs files in the following way:

  • Because MyProjectTree2 has multiple subdirectories that are either leaf nodes or subtrees, the MakeDirs utility considers MyProjectTree2 to be a subtree. Therefore, the utility creates a Dirs file in MyProjectTree2. This Dirs file specifies the two leaf nodes (Leaf1 and Leaf2) in addition to the subtree (SubTree1) that is nested within the project source tree.

  • The utility creates a Dirs file in the nested subtree (MyProjectTree2\SubTree1). This Dirs file specifies the two leaf nodes (SubTree1\Leaf1 and SubTree1\Leaf2) that are nested within this subtree.

After you run the MakeDirs utility for your project source tree, you do not have to run it again unless you add or delete subtrees within your project source tree.

 

 

Send comments about this topic to Microsoft

Build date: 5/3/2011