Wednesday, April 10, 2013

Tweak my runtime image Build [4/4]

Hi Folks,

Last but not least article from that serie, we will look on the way to customize the build without impacting the BSP files. This will ensure that only your current OSDesign is the one impacting its own runtime image.

We are going to use the batch files and same technics as the one described in the previous articles, except that all the scripts and configuration files will be located inside a OSDesign Subproject. By creating a generic Subproject you will be able to reuse it on various projects OSDesign.
So first we do have to create a Subproject, which require to open an existing OSDesign in Visual Studio. For this you have to proceed as following :

  1. From VS2008 Project menu, select Add New Subproject
  2. Select WCE Console Application project template and name it BuildTweaker
  3. Hit next and select An empty subproject
  4. It should add a new subproject to the OSDesign
  5. Edit the sources files of the BuildTweaker project and replace (at line 20) TARGETTYPE=PROGRAM to TARGETTYPE=NOTARGET, to ensure that it won't look for source code to compile.
The batch files to be executed during the make image step have to be located in the Flat Release Directory (%_FLATRELEASEDIR%), then to get those files copied to the appropriate folder on time, we can modify the postbuild.bat file of the project.
  1. Create the batch files and store them into the BuildTweaker\batch folder.
  2. Edit the postbuild.bat file
@REM Add post-link commands below.
@echo off

echo copying batch files
copy "%_OSDESIGNROOT%\BuildTweaker\batch\*.*" "%_PROJECTROOT%\cesysgen\oak\target\%_TGTCPU%\%WINCEDEBUG%"
copy "%_OSDESIGNROOT%\BuildTweaker\batch\*.*" "%_FLATRELEASEDIR%"



- Nicolas

No comments:

Post a Comment