1 / 19

Windows CE 的构建系统

Windows CE 的构建系统. Build 的几个阶段. 当你在 IDE 的 Biuld 菜单下选择 Build Platform 命令时,系统创建平台依次经历了以下4个过程 :. Sysgen 阶段 Build 阶段 Release Copy 阶段 Make Image 阶段. Sysgen 阶段任务. 主要功能是根据用户设置的一些组件环境变量,生成相应的头文件及可执行文件,供最终的 Windows CE 运行时映像打包时使用。 . System Generation. Complete header and source code files.

faolan
Download Presentation

Windows CE 的构建系统

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Windows CE的构建系统

  2. Build的几个阶段 当你在IDE的Biuld菜单下选择Build Platform命令时,系统创建平台依次经历了以下4个过程: • Sysgen 阶段 • Build 阶段 • Release Copy阶段 • Make Image阶段

  3. Sysgen 阶段任务 • 主要功能是根据用户设置的一些组件环境变量,生成相应的头文件及可执行文件,供最终的Windows CE运行时映像打包时使用。 

  4. System Generation Complete header and source code files System-specific header files SYSGEN.BAT Complete system libraries Linked libraries Module definitions (.def) Specific .def files Cesysgen.bat

  5. Build 阶段任务 • 所有的用户属性,包括PB工程文件(.pbp) ,dirs文件,源文件, makefiles (.mak) 被编译和创建

  6. 原码结构 • DIRS • SOURCES • MakeFile • makefile.def

  7. DIRS 文件 • DIRS • 类似工作空间“Workspace”中包含的工程“projects”列表 • 文本文件列出了包含其它DIRS or SOURCES文件的目录列表 • BUILD.EXE 通过读DIRS文件确定build的内容 • 例如: DIRS=\ Eboot \ Drivers

  8. SOURCES • SOURCES文件包含要编译的源代码文件列表等一系列宏 • SOURCES • 工程的源文件列表 • TARGETNAME • 最终生成的exe,dll或lib文件的文件名(非扩展) • TARGETTYPE • PROGRAM – (.EXE) Application • DYNLINK – (.DLL) Dynamic Link Library • LIBRARY – (.LIB) Static library

  9. %_MAKEENVROOT% MAKEFILE.INC MAKEFILE.DEF Local project folder SOURCES SOURCES与Makefile的关系

  10. Release Copy 阶段任务 • 拷贝所有用户生成OS镜像所需的文件到release目录下,在Sysgen阶段生成的模块和文件首先被拷贝,接着是Build阶段生成的模块和文件.

  11. Make Image 阶段任务 • Rrelease目录中的文件被整合的二进制镜像文件 Nk.bin中. • 这一阶段对应Build菜单下的Make Image命令

  12. Build 过程 COMMON DATASYNC DCOM DIRECTX IE RDP SCRIPT SERVERS WCEAPPSFE WCESHELLFE … ..\cesysgen\ddk ..\cesysgen\oak ..\cesysgen\sdk \target, \files Step 1. System Generation Step 2. Build ..\platform\.. \target, \files Step 3. Release Copy %_FLATRELEASEDIR% Step 4. Making an Image NK.BIN

  13. Build 结果 • nk.bin : • Windows CE 二进制镜像数据格式 • 运行时必须首先装载到内存中. • 由数据段和代码段组成 • nk.nb0 : • 二进制数据文件格式 • 能够被转载到Flash中 • 可以以 XIP模式运行

  14. 如何解决 Build 中的错误 • 查看 Output窗口 • No enough hard disk space • Compile & link error • 检查WINCE 根目录下的 Build.log & Build.err& Build.wrn文件 • 详细的输出信息

  15. 解释Build Errors • Sysgen阶段的错误 • Caused by missing files, missing configuration of the operating system features, and applications built during the Sysgen phase • Module build阶段的错误 • Compilation errors or unresolved link errors • Building the release directory阶段的错误 • File copy errors • Making an image阶段的错误 • Romimage.exe failed in CE.BIB • Romimage.exe failed in reginit.ini • Warning: Image exceeds

  16. 有用的命令行工具 • Wince.bat • Blddemo.bat • Cebuild.bat • Build.exe • Sysgen.bat • Buildrel.bat • Makeimg.exe

  17. Wince.bat • 用来创建命令行构建环境。它会设置一些新的环境变量,这些环境变量会指向Windows CE源代码树的某些目录,并且在以后的步骤中被构建系统使用 • 通过3个输入参数为宿主机准备开发环境 • %_TGTCPU% • %_TGTPROJ% • %_TGTPLAT% • 例: wince x86 MYPROJ CEPC

  18. BldDemo.bat • 用来build 和生成 OS 镜像 • 它调用3个工具: • Cebuild.bat: 负责执行整个Sysgen和Build过程,包括编译源代码和链接库文件 • Buildrel.bat:负责执行Release Copy过程,把生成的文件复制到_FLATRELEASEDIR目录 • Makeimg.exe:负责把_ FLATRELEASEDIR目录下的文件按照BIB文件的指示打包成最终的bin,产生OS镜像

  19. Build.exe • 用来构建、创建各种项目 • DIRS文件定义目录结构 • 自动监测源文件和头文件的依赖关系 • Windows CE Build过程的核心 • 调用NMAKE.EXE 做真正的build • DIRS和SOURCES 决定build的内容

More Related