Bill Of Materials File

I often add a BillOfMaterialsFile (a BOM) to directories that contain source code.

A BOM is a list of files that are expected to be in the directory.

I have make rules that check the files actually in the directory against the files in the BOM. Files that are not in the BOM are reported, so that I can add them if necessary. Files that are expected to be in the BOM are reported.

Most importantly, I nearly always have a "make BOMclean" target that removes all files not in the BOM.


The BOM is slightly annoying, because a file must be added to both CVS and the BOM.


The BOM helps in several ways:


Some folks extend the BillOfMaterialsFile to contain stuff like


I've seen this organization in a lot of projects and always wondered why. People accept that a source file should be an input to the build process or an intermediate generated file, but not both. If they don't allow hybrid files, why allow hybrid directories that contain both source files and generated files? I prefer to treat source directories as read-only from the build tool's perspective, and put any intermediate and generated files elsewhere. My source directory is my "bill of materials".


CategoryOrganization


EditText of this page (last edited April 12, 2006) or FindPage with title or text search