IAR USING PRE- AND POST-BUILD ACTIONS
Using pre-build actions for time stamping
If necessary, you can specify pre-build and post-build actions that you want to occur before or after the build.
The Build Actions dialog box—available from the Project menu—lets you specify the actions required.
For more information about the Build Actions dialog box, see Build actions options, page 215.
Using pre-build actions for time stamping
You can use pre-build actions to embed a time stamp for the build in the resulting binary file. Follow these steps:
1 Create a dedicated time stamp file, for example, timestamp.c and add it to your project.
2 In this source file, use the preprocessor macros __TIME__ and __DATE__ to initialize a string variable.
3 Choose Project>Options>Build Actions to open the Build Actions dialog box.
4 In the Pre-build command line text field, specify for example this pre-build action:
cmd /c "del "$OBJ_DIR$\timestamp.o""
This command removes the timestamp.o object file.
Alternatively, you can use the open source command line utility touch for this purpose
or any other suitable utility that updates the modification time of the source file. For example:
"touch $PROJ_DIR$\timestamp.c"
5 If the project is not entirely up-to-date, the next time you use the Make command,
the pre-build action will be invoked before the regular build process.
Then the regular build process must always recompile timestamp.c and
the correct timestamp will end up in the binary file.
If the project already is up-to-date, the pre-build action will not be invoked.
This means that nothing is built, and the binary file still contains the timestamp for when it was last built.
ADDING AN EXTERNAL TOOL
The following example demonstrates how to add the tool Flex to the toolchain.
Thesame procedure can be used also for other tools.
In the example, Flex takes the file myFile.lex as input. The two files myFile.c and myFile.h are generated as output.
1 Add the file you want to work with to your project, for example myFile.lex.
2 Select this file in the workspace window and choose Project>Options. Select Custom Build from the list of categories.
3 In the Filename extensions field, type the filename extension .lex. Remember to specify the leading period (.).
4 In the Command line field, type the command line for executing the external tool, for example
flex $FILE_PATH$ -o$FILE_BNAME$.c
During the build process, this command line is expanded to:
flex myFile.lex -omyFile.c
Note the usage of argument variables.
Note specifically the use of $FILE_BNAME$ which gives the base name of the input file,
in this example appended with the c extension to provide a C source file in the same directory as the input file foo.lex.
For more information about these variables, see Argument variables, page 71.
5 In the Output files field, describe the output files that are relevant for the build.
In this example, the tool Flex would generate two files—one source file and one header file.
The text in the Output files text box for these two files would look like this:
$FILE_BPATH$.c
$FILE_BPATH$.h
6 If the external tool uses any additional files during the build, these should be added in the Additional input files field, for instance:
$TOOLKIT_DIR$\inc\stdio.h
This is important, because if the dependency files change, the conditions will no longer be the same and the need for a rebuild is detected.
7 Click OK.
8 To build your application, choose Project>Make.
IAR USING PRE- AND POST-BUILD ACTIONS的更多相关文章
- ios添加pre和post build action
再vs中,我们可以很方便的再build前.后执行一些脚本为我们做点什么事情.再ios中怎么搞呢,哪必然是对xcode进行操作了.再google搜索了一把,有说操作Scheme的也有说再直接再targe ...
- IAR EWARM Checksum Technical Note
IELFTOOL Checksum - Basic actions EW targets: ARM, RH850, RX, SH, STM8 EW component: General issues ...
- Jenkins Post Build网址
Hudson Post build taskhttps://plugins.jenkins.io/postbuild-taskThis plugin allows the user to execut ...
- 痞子衡嵌入式:在IAR开发环境下RT-Thread工程函数重定向失效分析
大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家分享的是在IAR开发环境下RT-Thread工程函数重定向失效分析. 痞子衡旧文 <在IAR下将关键函数重定向到RAM中执行的方法> ...
- 痞子衡嵌入式:深扒IAR启动函数流程之段初始化函数__iar_data_init3实现
大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家分享的是IAR启动函数流程里的段初始化函数__iar_data_init3实现. 本篇是 <IAR启动函数流程及其__low_level_ ...
- 痞子衡嵌入式:在IAR开发环境下将整个源文件代码重定向到任意RAM中的方法
大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家分享的是在IAR开发环境下将整个源文件代码重定向到任意RAM中的方法. 痞子衡旧文 <在IAR下将关键函数重定向到RAM中执行的方法> ...
- 【STM32H7教程】第6章 STM32H7工程模板建立(IAR8)
完整教程下载地址:http://forum.armfly.com/forum.php?mod=viewthread&tid=86980 第6章 STM32H7工程模板建立(IAR8) 本章 ...
- 痞子衡嵌入式:飞思卡尔Kinetis系列MCU启动那些事(2)- KBOOT形态(ROM/Bootloader/Flashloader)
大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家介绍的是飞思卡尔Kinetis系列MCU的KBOOT形态. 痞子衡在前一篇文章里简介了 KBOOT架构,我们知道KBOOT是一个完善的Bootl ...
- Calculate CRC32 as in STM32 hardware (EWARM v.5.50 and later)
http://supp.iar.com/Support/?note=64424&from=note+11927 BackgroundThe STM32 devices from ST Micr ...
随机推荐
- 嵌入式 十个最值得阅读学习的C开源项目代码
开源世界有许多优秀的开源项目,我选取其中十个最优秀的.最轻量级的C语言的项目,希望可以为C语言开发人员提供参考. 十个最值得阅读学习的C开源项目代码 1. Webbench 2. Tinyhttpd ...
- Twitter Storm: storm的一些常见模式
这篇文章列举出了storm topology里面的一些常见模式: 流聚合(stream join) 批处理(Batching) BasicBolt 内存内缓存 + fields grouping 组合 ...
- Ubuntu 升级到13.10之后出现Apache2启动失败的问题
昨天看到Ubuntu 13.04提示有新的发行版Ubuntu 13.10了,手痒了一下,没有忍住就升级了. 结果升级完毕之后发现Apache2服务启动失败了,失败信息是: Invalid comman ...
- iOS学习笔记之回调(二)
写在前面 上一篇学习笔记中简单介绍了通过目标-动作对实现回调操作:创建两个对象timer和logger,将logger设置为timer的目标,timer定时调用logger的sayOuch函数.在这个 ...
- Java核心 --- 注解
Java核心——注解 注解是jdk5以后的新特性,Spring和Hibernate等框架提供了注解的配置方式使用, 本文参考了浪曦风中叶的注解讲解,主要讲解jdk内置注解的用法,注解的声明和定义,以及 ...
- JavaScript 性能优化 --By Google V8 Team Manager
原文:https://developers.google.com/v8/?hl=zh-CN Be Prepared before writing code[9:35] Understand how V ...
- Struts1与Struts2的异同
1.都是MVC的WEB框架 2.struts1是老牌框架,应用很广泛,有很好的群众基础,使用它开发风险很小,成本更低: struts2虽然基于这个框架,但是应用群众并不多,相对不成熟,未知的风险和变化 ...
- Excel的 OleDb 连接串的格式
Excel的 OleDb 连接串的格式(Provider=Microsoft.ACE.OLEDB)(2012-08-02 13:04:20) string strCon = "Provide ...
- QS之warning message
Multiple message categories are specified as a comma separated list.
- [POJ] #1006# Biorhythms : 最小公倍数/同余问题
一. 题目 Biorhythms Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 127263 Accepted: 403 ...