首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

MDK FCARM使用

MDK FCARM使用

FCARM是MDK RL-ARM库提供的一个网页文件转化(为.c文件的)工具。FC就是指File Convertor。    FCARM工具支持html,cgi,css,js等各类网页文件,并把他们转化成一个.c文件,然后再和整个工程一起编译。同时FCARM也会对这些文件进行压缩和优化。


GroupExtensionOptimization~Optimization (disabled)
HTMLhtml
htm
inc
HTML compression
Performs the following optimizations:
  • replaces tab characters with spaces
  • removes line-termination CR-LF characters
  • replaces multiple spaces with a single space
  • removes leading and trailing spaces
  • removes space between two html tags (for example, "<ul> <li>")
no compression
CGIcgi
cgx
CGI compression
Optimizes scripts for maximum performance on TCPnet web server:
  • checks the script syntax
  • replaces T,C,I,# script commands with tokens
  • replaces tab characters with spaces
  • removes line-termination CR-LF characters
  • removes multiple spaces
  • removes comments from script lines
  • groups small t-commands
white space removal but without grouping of small t-commands
CSScssCSS compression
Parses and removes redundant information:
  • replaces multiple spaces with a single space
  • removes line-termination CR-LF characters
  • replaces tab characters with spaces
  • removes "/*" and "//" style comments
  • removes redundant spaces inserted in the 1st step
  • removes spaces nearby a delimiter: :;{}
no optimization
JSjsJS compression
Parses and removes redundant information:
  • replaces tab characters with spaces
  • replaces multiple spaces with a single space
  • removes line-termination CR-LF characters
  • removes "/*" and "//" style comments
  • removes redundant spaces inserted in the 1st step
  • removes spaces nearby a delimiter: .,:;=!+-*/&|<>(){}"?
no optimization
others.*not affectednot affected

FCARM.exe位于Keil的安装目录下的\ARM\Bin目录下。

FCARM的使用方法:(摘自KEIL官网说明文档)
ExamplesThe following command line converts and optimizes index.htm, creates the output C-file index.c, and creates the listing file index.lst.
FCARM index.htmThe following command line converts and optimizes a list of files, creates the output C-file web.c, and creates the listing file web.lst.
FCARM index.htm, keil.gif, llblue.jpg, system.cgi TO web.cThe following command line converts and optimizes a list of files, creates the output C-file web.c, and suppresses the creation of the listing file (nopr - directive). The files are located in the sub-folder Web_Files.
FCARM index.htm, keil.gif, llblue.jpg, system.cgi TO web.c nopr root(Web_Files)The following command line converts and optimizes a list of files, creates the output C-file web.c, and creates the listing file web.lst. The file doStuff.js is excluded from optimization.
FCARM index.htm, keil.gif, llblue.jpg, system.cgi, ~doStuff.js TO web.cThe following command line uses a command file.
FCARM @FCARM_command_file
==========================================================================================================================
RL-TCP范例中FCARM的使用举例:

web.inp文件内容:
  • index.htm, keil.gif, nxp_logo.gif, llblue.jpg, pabb.gif, home.png,  
  • network.cgi, leds.cgi, tcp.cgi, system.cgi, lcd.cgi, language.cgi,  
  • ad.cgi, pg_header.inc, pg_footer.inc, xml_http.js, buttons.cgi,  
  • ad.cgx, buttons.cgx to Web.c nopr root(Web)  


然后在web.inp文件的属性中设置了“转化”方法:


fcarm @@web\Web.inp这句话的意思是 fcarm.exe在命令行中执行,后面的参数就保存在这个文件中。两个@@相当于命令行中一个@。

另外TI也有一个类似的网页转化工具"MakeFSFile",而且是开源的。和FCARM的不同是:
1.FCARM产生的是一个.c文件,Makefsfile产生的是一个.h文件
2.FCARM把所有的文件转化后的数据存在一个数组中,Makefsfile为每一个文件生成一个数组。如果文件较多,只需要转化修改的文件,Makefsfile更有优势。
返回列表