November 25, 2009 06:20 by
tomg
A short while back, a colleague of mine approached me with a Windows CE build problem. His OS project included a component delivered by a third party that had a very complex source tree. Because of this convoluted tree, the Windows CE Build tool was unable to properly scan all the dependencies to determine whether or not the component should be built or not, and as a result, the component was often not getting rebuilt after a source code change that required a rebuild.
Had this been his own source, my colleague would have no doubt spent the time to analyze his build tree to try to find a way to fix the dependency checking. But since this was from a third party, to save time my colleague decided it would suffice if the component was built clean on every build. So, his question to me was “What can I do in my SOURCES file to force this one component to always build clean even when I don’t specify a clean build?”
The solution is pretty simple, and makes use of the WINCETARGETFILE0 macro in the SOURCES file. The master CE make file, MAKEFILE.DEF, defines a special NMAKE target called ‘clean’ that is used when you specify the –c command line option to the Build tool (build –c). The rules for ‘clean’ erase all of the targets that can be produced by the make file being processed. So, by adding the following line to the SOURCES file, the component will always be cleaned before it is built, just as though the –c command line option had been specified for that one component.
WINCETARGETFILE0=clean
c5d15112-9f40-483d-9728-16bf5338ebdb|1|5.0