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.
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.
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.
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.
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.
GNUStep provides 'pbxbuild' to convert a .xcodeproj file into a GNUMakefile.
UPDATE: pbxbuild is now deprecated
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..
The pasted output is FULL pathnames to each source file.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With