Sources.cmn is a build configuration system file that allows you to set common variables. This can be useful if more than one directory in the build tree need the a variable set to the same value because it can reduce your maintenance efforts.
Each build tree can use one sources.cmn file. When build.exe runs, it will determine the root of the build tree by looking for the top most folder with a Dirs file. Build.exe then sets BUILDROOT to the top most folder with a Dirs files. Makefile.def in Public\Common\OAK\Misc will include $(BUILDROOT)\sources.cmn if it exists.
Some of the variables that are commonly set in sources.cmn include CDEFINES, ADEFINES and INCLUDES.
CDEFINES and ADEFINES are used to set macros that are common to multiple build folders. These might include RAM and ROM sizes, but might also include OEM and CPU specific macros.
The include path, INCLUDES, can be set in sources.cmn which is very helpful, especially if and when you change the directory structure.
The Platform directory tree should have WINCEOEM set to 1, so sources.cmn is a good place to do this rather than setting it in each sources file.
Note: Starting with Windows CE 5.0, sources.cmn is no longer really an option. It is required because sources.cmn needs to at least set _COMMONPUBROOT, _ISVINCPATH, and _OEMINCPATH. These were set by build.exe in prior versions.
This macro definition specifies compiler DEFINE statements.
These DEFINE statements are added at the end of the standard DEFINE statements put in by Makefile.def.
The default value is NULL.
This macro definition specifies command-line options that are passed to the assembler.