bash 如何使用现有文件创建新的 Xcode 项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4087916/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 22:51:17  来源:igfitidea点击:

How to create a new Xcode project with existing files?

cgitbashmakefilexcode3.2

提问by jon2512chua

Hey guys I've initially posted this both in superuser as well as programmers but I haven't gotten any replies yet, and someone suggested here, so I thought I'll ask it again here:

嘿伙计们,我最初在超级用户和程序员中都发布了这个,但我还没有得到任何回复,有人建议在这里,所以我想我会在这里再问一次:

I'm currently using XCode 3.2, and I am already working on my existing project using the terminal and vim. Files/folders that already exists are:

我目前正在使用 XCode 3.2,并且我已经在使用终端和 vim 处理我现有的项目。已经存在的文件/文件夹是:

  • C source files
  • C header files
  • makefile
  • bash script for automatic testing
  • test directories
  • git
  • a library archive, most probably of C object files (if it helps it has an extension of .a)
  • C源文件
  • C头文件
  • 生成文件
  • 用于自动测试的bash脚本
  • 测试目录
  • 混帐
  • 一个库档案,很可能是 C 目标文件(如果它有帮助,它的扩展名为 .a)

My current program basically syncs 2 or more directories given to it as arguments in the terminal and syncs them recursively. I'm trying to use Xcode in hopes that it'll help in debugging and improving my workflow in general.

我当前的程序基本上同步了在终端中作为参数提供给它的 2 个或更多目录,并递归地同步它们。我正在尝试使用 Xcode,希望它有助于调试和改进我的工作流程。

EDIT
Just to clarify I want to actually create a new Xcode project and import all my current code, makefile, git repo, testing script etc and not write the code to do it.

编辑
只是为了澄清我想实际创建一个新的 Xcode 项目并导入我当前的所有代码、makefile、git repo、测试脚本等,而不是编写代码来执行此操作。

回答by mipadi

Create a new project with the "Command Line Tool" template (select "C" as the type), and import your files. alt text

使用“命令行工具”模板创建一个新项目(选择“C”作为类型),然后导入您的文件。 替代文字

If you want to use your Makefile instead of managing the build process via Xcode, you can create a new target with a custom build phase that'll invoke your own Makefile.

如果您想使用您的 Makefile 而不是通过 Xcode 管理构建过程,您可以创建一个具有自定义构建阶段的新目标,该阶段将调用您自己的 Makefile。