代码改变世界

Platform Builder: Sources.cmn

2009-12-17 12:08  Andy Ge  阅读(456)  评论(0编辑  收藏  举报

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.
For more on sources files take a look at: Platform Builder: Sources Files