Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you generate a Makefile from an Xcode project?

I want to generate a Makefile from an existing Xcode project on the Mac. Specifically, an existing iPhone, Objective-C program on the Mac.

I found PBToMake, but it looks like it is for Xcode 2.1 and when I tried using it, it did not work for an Xcode 3.1 project.

like image 248
Tim Avatar asked Sep 18 '08 18:09

Tim


People also ask

What is a makefile project?

A makefile is a text file that contains instructions for how to compile and link (or build) a set of source code files. A program (often called a make program) reads the makefile and invokes a compiler, linker, and possibly other programs to make an executable file.

How do I open an existing code in Xcode?

Importing into Xcode Open Xcode and select Open Another Project or File, Open. Open the folder you unzipped from your Dropsource download and locate the file with “. xcodeproj” extension in the root directory. Select the file and click Open.

What is external build system Xcode?

When invoking an external build, Xcode defines environment variables for its build settings. These settings define where build files are created, as well as compiler and linker flags. We use Make's conditional directives to modify the build when it is invoked by Xcode.

How do I import a project into Xcode?

In the Project navigator, select the project, then choose Product > Import Localizations. In the import dialog that appears, select the Xcode Localization Catalog folder, and click Import. Xcode ingests the files and warns you if there are untranslated files.


3 Answers

GNUStep provides 'pbxbuild' to convert a .xcodeproj file into a GNUMakefile.

UPDATE: pbxbuild is now deprecated

like image 73
rage Avatar answered Oct 13 '22 22:10

rage


It's not an automated way of generating a Makefile, but I found it at least gets a list of source files that are built for a target.

I'm using Xcode 4.0.2 in this case..

  • select the project top node
  • select the target in the target list.
  • Choose "Build Phases"
  • Open the "Compile Sources"
  • Select one of the source files
  • PRess Command-A to select all
  • Press Command-C to copy
  • Paste in your favorite text editor and Regex away to restructure.

The pasted output is FULL pathnames to each source file.

like image 21
Urkle Avatar answered Oct 13 '22 22:10

Urkle


Xcode does not support generating a Makefile from a project. If you just want to build your project outside of the IDE, check out the xcodebuild command-line tool.

like image 25
Chris Hanson Avatar answered Oct 13 '22 23:10

Chris Hanson