Dirs files are the direction signs for building your platform. They show the way for build.exe to find your code to build it. Dirs files are probably the best named files in the build system because what they do is tell build.exe which sub directories to descend into to build.   If you have looked around at the files in your platform, then you probably are familiar with the basic form of a dirs file, here is an example:
                Serial \
                USB \
This dirs file tells build to descend into three folders; Serial, USB and Wave.  Notice that like macro definition (#define) the dirs file uses line continuation using ‘\’ followed by a newline. So build.exe sees this as “DIRS=Serial USB Wave” and you could just as easily write it in the dirs file that way. I prefer separate lines because it makes it easier to edit the file later.
DIRS can also be set to build all sub directories using ‘*’; example
I could stop here, but there is another powerful feature of dirs files, the OPTIONAL_DIRS setting. OPTIONAL_DIRS lets you have directories that are built sometimes and other times they are not built. The OPTIONAL_DIRS are list in the dirs files similar to the DIRS setting:
                PXA \
This tells build.exe that it may need to build the directories PXA and/or SMI. Build.exe will then build the folders if it has one of them listed in the environment variable BUILD_OPTIONS. So if we want to build SMI, we can add the following to <platform>.bat:
One key rule for Dirs files is that they cannot coexist in a directory that contains a sources files.
Copyright © 2008 – Bruce Eitman
All Rights Reserved