如何指导X code到使用YASM编译.asm的文件吗? [英] How to instruct Xcode to use yasm to compile .asm files?

查看:940
本文介绍了如何指导X code到使用YASM编译.asm的文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能指示X code到使用YASM编译.asm的文件吗?我有一个X $ C $ 4.0Ç项目设置编译C和C ++文件就好了,但是,X code不知道做什么用.ASM文件执行。我已经有安装二进制工具YASM,它只是一个指导使用YASM编译.ASM文件第X code的问题。

How can I instruct Xcode to use YASM to compile .asm files? I have a Xcode 4.0 project setup to compile C and C++ files just fine, however, Xcode doesn't know what to do with .asm files. I've already got the binary tool yasm installed, it's just a matter of instructing Xcode of using Yasm to compile .asm files.

有关Visual Studio中,我用的是Y​​ASM规则,并为Linux我修改了生成文件。但是,我不知道如何配置X code到使用YASM。

For Visual Studio, I use the Yasm rules, and for Linux I modified the makefile. However, I do not know how to configure Xcode to use yasm.

任何想法?

推荐答案

安装YASM。 (或MacPorts的BREW或DIY)

Install yasm. (MacPorts or brew or DIY)

选择在Project Navigator工程项目。
从目标列表中选择目标。
选择生成规则标签项。
点击添加构建规则按钮。
从大会文件(来源$ C ​​$ c.asm)过程,弹出选择。
选择自定义脚本:从使用弹出

Select the project item in the Project Navigator. Select the target from the TARGETS list. Select the "Build Rules" tab item. Click "Add Build Rule" button. Choose "Assembly files (sourcecode.asm) from the "Process" pop-up. Choose "Custom script:" from the "Using" pop-up.

输入的YASM构建命令到脚本区域。例如:

Enter the yasm build command into the script area. For example:


#!/bin/bash
/usr/local/bin/yasm -f macho32 -o ${OBJECT_FILE_DIR_normal}/${CURRENT_ARCH}/${INPUT_FILE_BASE}.o ${INPUT_FILE_DIR}/${INPUT_FILE}

...添加输出文件($ {OBJECT_FILE_DIR_normal} / $ {CURRENT_ARCH} / $ {INPUT_FILE_BASE}的.o)来输出的文件的列表。

Add the output file ("${OBJECT_FILE_DIR_normal}/${CURRENT_ARCH}/${INPUT_FILE_BASE}.o") to the list of output files.

壳变量用X code定义并添加到外壳执行环境。我确定这些指示没有与任何YASM之前熟悉,所以我道歉,如果有,我调用任何错误。好像在我的情况下工作,虽然。

The shell variables are defined by Xcode and added to the shell execution environment. I determined these instructions without any prior familiarity with yasm, so I apologize if there are any errors in my invocation. Seems to be working in my case, though.

这篇关于如何指导X code到使用YASM编译.asm的文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆