1 / 14

编 译

编 译. 吴 磊. 编译环境. OS Windows 2000, XP, WinME. The recommended OS is Windows 2000 with SP2 or later. Compiler ADS v1.2. The recommended build version is build 842. ADS 安装:

jude
Download Presentation

编 译

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. 编 译 吴 磊

  2. 编译环境 • OS • Windows 2000, XP, WinME. The recommended OS is Windows 2000 with SP2 or later. • Compiler • ADS v1.2. The recommended build version is build 842. • ADS安装: • 1、ads-arm目录下安装 2、选择ads目录下license 3、 Build842.rar解压 4、 ARMpatch.rar替换安装目录下相应位置的文件 • 默认ARM目录: • DIR_ARM = c:\progra~1\arm\adsv1_2 • DIR_ARM := $(strip $(DIR_ARM)) • DIR_TOOL = $(DIR_ARM)\bin • DIR_ARMLIB = $(DIR_ARM)\lib • DIR_ARMINC = $(DIR_ARM)\include

  3. 编译环境 • Perl interpretor • ActivePerl. The recommended version is ActivePerl 5.6.1. • if (($action eq "remake") || ($action eq "update") || ($action eq "new")|| ($action eq "bm_new")) { if ($action eq "bm_new") { system("echo BM_NEW=TRUE >> ${makeFolder}~buildinfo.tmp"); • $result = system("${makeCmd} -f${makeFolder}${myMF} -k -r -R CUSTOMER=$custom PROJECT=$project new"); • } • tools\make.exe -fmake\gsm2.mak -r -R CUSTOMER=mtk PROJECT=gprs new

  4. 编译环境 • 3 part 软件:MinGW+MinSYS 7za • MinGW: Minimalistic GNU on Windows • MinSYS: Minimal System • GCC for Win32开发环境,类似的还有cygwin。MinGW最初从 CygWin 的基础上发展而来,力求在 Windows 上建立一个提供最低限依赖要求的由一系列 GNU 工具构建而成的应用、开发环境;它更多的要依赖于 Win32 API。

  5. 编译连接工具 • 编译器 • armasm.exe • armcc.exe • CFLAGS := -cpu ARM7EJ-S -littleend -O2 -zo –fa(6226) • 链接器及开关: • armlink • ($(LINK) $(VIA) make\~libs.tmp > $(LOG) • fromelf.exe • $(BIN_CREATE) $(strip $(TARGDIR))\$(IMG_FILE) $(BIN_FORMAT) -output $(strip $(TARGDIR))\$(BIN_FILE)

  6. Make file • Makefile的规则 • target ... : prerequisites ... • command • 在默认的方式下,也就是我们只输入make命令。那么, • 1、make会在当前目录下找名字叫“Makefile”或“makefile”的文件。 • 2、如果找到,它会找文件中的第一个目标文件(target),在上面的例子中,他会找到“edit”这个文件,并把这个文件作为最终的目标文件。 • 3、如果edit文件不存在,或是edit所依赖的后面的 .o 文件的文件修改时间要比edit这个文件新,那么,他就会执行后面所定义的命令来生成edit这个文件。 • 4、如果edit所依赖的.o文件也存在,那么make会在当前文件中找目标为.o文件的依赖性,如果找到则再根据那一个规则生成.o文件。(这有点像一个堆栈的过程) • 5、当然,你的C文件和H文件是存在的啦,于是make会生成 .o 文件,然后再用 .o 文件生命make的终极任务,也就是执行文件edit了。

  7. 编译构架

  8. 编译流程 • ResGenerator_HW.bat只编译资源

  9. 编译流程

  10. 编译流程

  11. 主要文件 • Xxx_GPRS.mak:针对不同的客户和项目的配置列表 • Option.mak:项目选项,宏定义,构建脚本 • Verno_xxx.bld:版本构建脚本 • Comstom.bld:保存了MTK释放软件时的变量,此文件不修改。 • \\build\$custom: • target编译结果,包括*.o, 各模块log信息及link的log,.bin, .elf,.lis, .sim, .dep • \plutommi\Customer\ResGenerator\mtk_resgenerator.log • 编译资源时产生的log • scatXXXXX.txt • Scatter file for customer platform. It will define the starting address and length of ROM, External RAM, and Internal RAM

  12. 编译命令 • Make [custom=customerName]<project><platform><action>[module] • Custom = MIKI26_06B … • Project = GPRS GSM • Action = new update remake clean • Module = custom drv plutommi…

  13. 增加模块 • 1、增加模块到COMPLIST • CUS_REL_SRC_COMP += xyz • 2、增加makefile相关文件 • \make\xyz • xyz.lis xyz.inc xyz.pth xyz.def

  14. Thank you!

More Related