完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我有几个项目,每个项目都包含多个配置,在构建过程中,我只想在一半的配置上做一些后生成处理。这不是我的应用程序,但想象一下调试和发布配置,只想对生产生成工件进行后期处理。有一种方法可以做到:像$(CONF)值不能工作,因为在生成MaFIX文件时它没有被设置。对于所有配置,这都是空的:这是怎么做的?我曾尝试使用shell脚本来比较$(CONF)值,但是即使在那个点正确地设置了$(CONF),也没有能够得到工作。
以上来自于百度翻译 以下为原文 I've got several projects each containing multiple configurations and in the build process I'd like to do some post-build processing only on half of the configurations. This is not my application, but imagine a debug and release configurations and only wanting to post-process the production build artifacts. Is there a way to do something like: ifeq "$(CONF)" == "config1_name" ..post-build stuff.. endif The $(CONF) value won't work because it isn't set when the Makefile is parsed. This echos EMPTY for all configurations: ifeq "$(CONF)" "" @echo EMPTY endif Is there a way this can be done? I've tried using shell scripting to compare the $(CONF) value but haven't been able to get that working either even although $(CONF) is correctly set at that point. |
|
相关推荐
4个回答
|
|
MplabX?还是MPLAB8?MPLABX在生成选项中有一个后进程。
以上来自于百度翻译 以下为原文 MplabX? or Mplab8? MplabX has a post Process in the build options. |
|
|
|
这很有趣,我最初把它放在MPLABX论坛,然后决定它在这里,所以我移动它没有注意到。所以,MPLabX。我还使用了几种不同版本的XC16、1.1、1.25和1.32安装但未被使用。编译后的编辑是在项目目录中生成文件(按指示)。上面的注释适用于如果添加到PuxBuy处理程序部分中会发生什么。将在后生成点定义$(CONF),但任何条件(IF,IFEQ,ORE,Endif)都会出现在加载时,当$(Co)时。NF尚未定义。
以上来自于百度翻译 以下为原文 That's funny, I originally posted this in the MPLabX forum and then decided it goes here so I moved it without making note of that. So, MPLabX. I'm also using several different versions of XC16, 1.1, 1.25 and 1.32 is installed but isn't being used. The post-build edits are to Makefile in the project directory (as directed). The comments above apply to what happens if you add to the post-build handler section. $(CONF) will be defined at that post-build point, but any conditional (if,ifeq, else,endif) appears to be handled at load time, when $(CONF) is not yet defined. |
|
|
|
把这件事再提出来,因为我没有主意了。我尝试得到一个BASH shell,否则,但遇到一个问题,即没有BASH shell,如果命令可用。调用shell命令有两种不同的方法,@命令或${shell命令}这两种方法都是用相同的方法生成的吗?Windows机器上是否使用CMDC+调用交叉编译UNIX工具来模拟UNIX构建过程?我看过关于CygWin的评论,但没有看到MPLAB工具安装的任何CygWin。我想做一些事情:当我尝试这个,我得到一个错误,扩展${CONF}是意想不到的,这表明这将不会在这个环境下工作。有什么想法如何获得额外的BASH shell功能从MaX文件内?
以上来自于百度翻译 以下为原文 Bring this up again because I'm out of ideas. I did try to get a bash shell if-then-else but ran into a problem that there is no bash shell if command available. There are two different methods for invoking shell commands, the @command or the ${shell command ...} Are both methods spawned off the same way? Does make on windows machines just use cmd.com and call cross-compiled unix tools to simulate the unix build process? I've seen comments about cygwin but didn't see any cygwin installed by the mplab tools. I'd like to do something like: if [ ${Conf} = "buildname" ]; then stuff; else stuff; fi; When I try this I get an error the expanded ${conf} is unexpected which suggests this ain't gonna work in this environment. Any ideas on how to get additional bash shell functionality from within the makefile? |
|
|
|
MPLAB X论坛将是正确的论坛,因为这与编译器无关。正常的后期构建步骤将是最简单的方法,只需在测试配置变量的脚本中封装您的POST进程命令。如果这是一个用户MaFrimeProject,您可以设置VALIAB。LES在命令行上,可以稍后进行测试。CONF变量被设置为生成的MaxFrm文件中的硬编码值(NBPyt/MaFixIMP.MK),因此我认为它不能自动用于其他类型的项目。
以上来自于百度翻译 以下为原文 The MPLAB X forum would have been the correct forum, since this has nothing to do with the compiler. A normal post-build step would by far be the simplest way, just wrap your post-process command in a script that tests the configuration variable. If this is a user makefile project, you can set variables on the command line, which can later be tested. The CONF variable is set to a hard-coded value in the generated makefiles (nbproject/Makefile-impl.mk), so I don't think it's automatically available for other types of projects. |
|
|
|
只有小组成员才能发言,加入小组>>
5243 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3208 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2258 浏览 5 评论
779浏览 1评论
672浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
598浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
682浏览 0评论
579浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 22:42 , Processed in 1.196789 second(s), Total 84, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号