Xcode 和 makefile
我想要实现的目标:我正在将应用程序移植到 iPhone,我需要通过编译器(我们的优化工具)在生成的程序集上运行一些脚本,然后将其编译为可执行文件。我总是使用标准的 make 文件并做了类似的事情
gcc -S -c my_source.c # compile and generate ASM
optimize.sh my_source.s # optimizations
gcc CCFLAGS my_source.s # compile
不幸的是,没有办法从 xcode 项目生成 makefile(我尝试了一些工具,但没有一个真正起作用)。我想知道你们中是否有人能解决我的问题。我知道我可以从头开始编写一个 makefile,但这不是一个好主意。也欢迎任何其他解决方案。
谢谢
What I want to achieve: I'm porting an application to iPhone and I need to run some scripts on the generated assembly by the compiler (our optimization stuff) and then compile it to an executable. I always used a standard make file and did something like this
gcc -S -c my_source.c # compile and generate ASM
optimize.sh my_source.s # optimizations
gcc CCFLAGS my_source.s # compile
Unfortunately, there's no way to generate makefile from xcode projects (I tried some tools, but none of them actually works). I was wondering if any of you got a solution for my problem. I know I can write a makefile from scratch, but it's not a good idea. Any other solutions are welcomed too.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过更改 Xcode 中目标的默认规则来实现此目的,以便对 .c 文件进行特殊处理。然后,您将使用自定义脚本来编译 .c 文件,而不是默认行为。
选择您的目标,获取信息,然后查看“规则”选项卡。
You can do this by changing the default rules for your target in Xcode so that .c files are treated specially. You would then use a custom script for compiling .c files rather than the default behaviour.
Select your target, Get Info, then look at the Rules tab.