Friday, 17 October 2008

How to SYSGEN subcomponents separately

As you might know, the standard way to SYSGEN a (PUBLIC) Windows CE component is to first build the <my_component>_lib.lib and SYSGEN it to the <my_component>.dll or <my_component>.exe. This, of course, happens in accordance to the respective SYSGEN_VARIABLE, which in turn is responsible for setting the corresponding MODULE (e.g. CE_MODULES). This module is then used in the respective MAKEFILE to build the corresponding .dll or .exe. The just described procedure works well if you SYSGEN the whole component but if you only want to SYSGEN the subcomponent you probably get an error that might read something like: “NMAKE : fatal error U1073: don't know how to make '<my_component>_lib'”.

The solution to this problem can be found in _MAKEENVROOT\bldsys.bat: the attempt here is to match the MODULE in the sources file, the dirs file and the contents.oak file. If the MODULE is not found in either one, the TARGETNAME is used. So if you set MODULE=<modulename> (normally <modulename> equals <my_component>) in the sources file the SYSGEN of the desired subcomponent works without errors.

The FLUSH\OSCAPTURE subcomponent of CELOG (_PUBLICROOT\COMMON\SDK\SAMPLES\CELOG) could be used as an example: SYSGENing CELOG works, but you get the above mentioned error when trying to SYSGEN OSCAPTURE directly.

Have fun!

2 comments:

Anantha Ramaiah said...

thanks for the info. it is useful.

what is the command to be used to build a component (for example bluetooth stack) ? and where to execute the command?

Jochen Dieckfoß said...

Hi Anantha,

the bluetooth stack can be found at $(_WINCEROOT)\PRIVATE\WINCEOS\COMM\BLUETOOTH, the core can be found in the \SYS subdirectory. Now the $(_WINCEROOT)\PRIVATE\WINCEOS\COMM directory and therefore all its subdirectories are exclueded from build (the component ist precompiled for you). To complile it anyway, you would need to include it in the dirs file and call:
set WINCEREL=1&&build&&sysgen -p <component name>
from the command line in the coresponding directory that you want to build, or simply righ clicking the component in the solution explorer of Platform Builder and select "Build and Sysgen" afterwards (no matter it you use the command line or the IDE) you do need to call makeimg to include the component in your run-time image.

Have Fun!
-Jochen