IAR开发STM8,如何加入每次编译的日期时间信息来做为版本信息
2015-07-28 13:32
381 查看
IAR开发STM8,如何加入每次编译的日期时间信息来做为版本信息呢??
网上找打了这个:
--------
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""
在网上找了半天,终于找到了,
http://blog.chinaunix.net/uid-30127490-id-5062415.html
IAR的宏定义:
const char MenuStr[]={"T1xxxxxxxxxxP-xxE##"__DATE__"#####"}; //定义字符串常量
网上找打了这个:
--------
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""
在网上找了半天,终于找到了,
http://blog.chinaunix.net/uid-30127490-id-5062415.html
IAR的宏定义:
const char MenuStr[]={"T1xxxxxxxxxxP-xxE##"__DATE__"#####"}; //定义字符串常量
相关文章推荐
- C#判断一个类实现了一个接口
- jQuery中的.bind()、.live()和.delegate()之间区别分析(转)
- krpano音量控制(我们已经转移到krpano中国网站 krpano360.com)
- krpano音量控制(我们已经转移到krpano中国网站 krpano360.com)
- ubuntu彻底删除wine
- Xms Xmx PermSize MaxPermSize 区别
- PAT (Advanced Level) 1063. Set Similarity (25) set的相似度
- linux driver 简单实例
- Spring 注释 @Autowired 和@Resource 的区别
- 阿里电话面试
- 解析大型.NET ERP系统 20条数据库设计规范
- asterisk manager api 配置 (manager.conf)
- 黑马程序员----0704期java开发前奏
- Linux中fork()函数详解
- service中AIDL的应用
- Deviceiocontrol操作异常时,关于getlasterror的错误代码解析
- Codeforces Round #313 (Div. 2) D. Equivalent Strings(字符串+递归)
- Webform——Repeater多表联合显示
- 四种下拉菜单
- iOS开发使用代码创建一个Label控件