Xcode Project to Makefile

Does Apple's Developer Tool package include a tool for converting an Xcode project to a Makefile, for building from a shell prompt or script?

Thanks, that's the command I forgot - though it would be nice to see the dependencies listed in familiar Makefile format.

Similar Messages

  • Xcode project from makefile rules.

    Dear All,
    I have crashed into an old project but new to me and it was not setup for Xcode. I have successfully compiled it in the command line mode using Intel c++/fortran compilers and using Xcode to debug it.
    The thing is that Xcode complained about some preprocessor definitions not being defined; however, it is defined when I assign the flag during the compile time. Since it is already compiled, there is no way to give additional preprocessor definitions to the code.
    I am wondering if Xcode has anyway to derive the rule for code linking according to the binary it reads in. Apparently it can debug and walk through the code now, why can it not derive the building rules? I am just thinking a quicker way to replace the command line makefiles by a single Xcode project.
    Anyone?
    Thanks in advance.
    Alvyn

    Can't you just recompile with with the additional flags?
    Something that is already built with makefiles should probably be kept that way.

  • Xcode fails while makefiles work

    I am having problems setting up an xcode project for some given source code.
    I have already a build system based on makefiles for the source code that works fine (so the source code must be ok).
    Now i am trying to set up a xcode project for that source code. It is distributed over a small number of directories, consists (for now) of one library plus some test programs.
    Building the library seems to work fine, but when i build the test programs, i get linker errors.
    Here are the steps of the build process of xcode for one of the test programs (it is called 'unix') plus the ensuing linker error messages:
    CompileC /tmp/xcode/qhull.build/Release/unix.build/Objects-normal/ppc/unix.o /Users/zach/Code/CollDet/xcode/../common/qhull/test/unix.c normal ppc c com.apple.compilers.gcc.4_0
    cd /Users/zach/Code/CollDet/xcode
    /usr/bin/gcc-4.0 -x c -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -Wreturn-type -Wunused-variable -fmessage-length=0 -mtune=G5 -fvisibility=hidden -mmacosx-version-min=10.4 -I/tmp/xcode/qhull.build/Release/unix.build/unix.hmap -mdynamic-no-pic -F/Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release -I../common/boost/include -I../common/qhull -I/Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release/include -I/tmp/xcode/qhull.build/Release/unix.build/DerivedSources -isysroot /Developer/SDKs/MacOSX10.4u.sdk -c /Users/zach/Code/CollDet/xcode/../common/qhull/test/unix.c -o /tmp/xcode/qhull.build/Release/unix.build/Objects-normal/ppc/unix.o
    Ld /Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release/unix normal ppc
    cd /Users/zach/Code/CollDet/xcode
    /usr/bin/gcc-4.0 -o /Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release/unix -L/Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release -L../common/qhull/obj/xcode -L/Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode -F/Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release -filelist /tmp/xcode/qhull.build/Release/unix.build/Objects-normal/ppc/unix.LinkFileList -lqhull -arch ppc -Wl,-Y,1455 -mmacosx-version-min=10.4 -Wl,-dead_strip -nodead_strip_inits_andterms -isysroot /Developer/SDKs/MacOSX10.4u.sdk
    /usr/bin/ld: Undefined symbols:
    qh_checkoutput
    qh_checkpoints
    qhfreeqhull
    qh_initA
    qh_initB
    qhinitflags
    qhmemfreeshort
    qh_produceoutput
    qhqhull
    qhreadpoints
    I suspect that the problem is caused by the build process that builds the library, that something xcode is doing is wrong.
    Here are the last few steps of the build process for the library from xcode (the name of the lib is 'qhull'):
    CompileC /tmp/xcode/qhull.build/Release/qhull.build/Objects-normal/ppc/version_def.o /Users/zach/Code/CollDet/xcode/../common/qhull/version_def.cpp normal ppc c++ com.apple.compilers.gcc.4_0
    cd /Users/zach/Code/CollDet/xcode
    /usr/bin/gcc-4.0 -x c++ -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -Wreturn-type -Wunused-variable -fmessage-length=0 -mtune=G5 -fvisibility-inlines-hidden -mmacosx-version-min=10.4 -gdwarf-2 -I/tmp/xcode/qhull.build/Release/qhull.build/libqhull.hmap -F/Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release -I../common/boost/include -I../common/qhull -I/Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release/include -I/tmp/xcode/qhull.build/Release/qhull.build/DerivedSources -isysroot /Developer/SDKs/MacOSX10.4u.sdk -include /Library/Caches/com.apple.Xcode.501/SharedPrecompiledHeaders/qhullPrefix-farbtulhxcnosbgjasnnizwbbrip/qhullPrefix.pch -c /Users/zach/Code/CollDet/xcode/../common/qhull/version_def.cpp -o /tmp/xcode/qhull.build/Release/qhull.build/Objects-normal/ppc/version_def.o
    Ld /Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release/libqhull.dylib normal ppc
    cd /Users/zach/Code/CollDet/xcode
    /usr/bin/g++-4.0 -o /Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release/libqhull.dylib -L/Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release -F/Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release -filelist /tmp/xcode/qhull.build/Release/qhull.build/Objects-normal/ppc/libqhull.LinkFile List -arch ppc -Wl,-single_module -compatibility_version 1 -current_version 1 -install_name /usr/local/lib/libqhull.dylib -Wl,-Y,1455 -dynamiclib -mmacosx-version-min=10.4 -Wl,-dead_strip -nodead_strip_inits_andterms -isysroot /Developer/SDKs/MacOSX10.4u.sdk
    PBXCp ../common/qhull/obj/xcode/Release/../libqhull.dylib ../common/qhull/obj/xcode/Release/libqhull.dylib
    cd /Users/zach/Code/CollDet/xcode
    /System/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -strip-debug-symbols -resolve-src-symlinks /Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release/libqhull.dylib /Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release/..
    GenerateDSYMFile
    cd /Users/zach/Code/CollDet/xcode
    /usr/bin/dsymutil -o /Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release/libqhull.dylib .dSYM /Users/zach/Code/CollDet/xcode/../common/qhull/obj/xcode/Release/libqhull.dylib
    For comparison, here are the last few steps of the build process for the lib based on the makefiles:
    --- Compiling qhull_io.cpp to obj/macosxgcc_opt/qhullio.o
    g++ -ansi -O3 -funroll-loops -felide-constructors -ffast-math -DNDEBUG -Wall -W -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Woverloaded-virtual -Wsign-compare -Wnon-virtual-dtor -Woverloaded-virtual -Wfloat-equal -Wno-system-headers -Wdisabled-optimization -Wold-style-cast -Wshadow -w -Wno-reorder -I. -I../../common/boost/include -o obj/macosxgcc_opt/qhullio.o -c qhull_io.cpp
    ===============================================================================
    === Linking shared object obj/macosxgccopt/libqhull.dylib
    ===============================================================================
    g++ -dynamiclib -Wl,-single_module -flat_namespace -O3 -funroll-loops -felide-constructors -ffast-math -DNDEBUG -L. obj/macosxgccopt/geom.o obj/macosxgccopt/geom2.o obj/macosxgccopt/global.o obj/macosxgccopt/mem.o obj/macosxgccopt/merge.o obj/macosxgccopt/poly.o obj/macosxgccopt/poly2.o obj/macosxgccopt/qhull.o obj/macosxgcc_opt/qhullio.o obj/macosxgccopt/set.o obj/macosxgccopt/stat.o obj/macosxgccopt/user.o obj/macosxgcc_opt/versiondef.o -o obj/macosxgccopt/libqhull.dylib
    Are there any differences that might cause xcode to produce the linker errors?
    There are several command line options that are different from the compile/link commands issued by the makefiles.
    I have no idea what they do, where they come, or if they really might be the cause.
    For the record: i am building on a Powerbook, and not building a Universal binary.
    I will appreciate any suggestions, tips, pointers, etc.
    Best regards,
    Gabriel.
    Message was edited by: Gabriel Zachmann

    Why do you need to build in Xcode? If you already have makefiles that work, just use them so you don't have two development environments to maintain. I only ask that question because people seem to think Xcode is somehow required for building on MacOS X. It isn't, not for any project.
    Let's say, for whatever reason, you want to build it in Xcode. Another question. Why don't use use a makefile project? You can have all your code organized in Xcode how you want, and your build step is just to call "make" on the existing makefiles. You'll have some of the benefits of Xcode without having to maintain two development environments.
    Again. Let's say, for whatever reason, you want to build it in Xcode using a native project. Now come much harder questions. How did you setup your Xcode project? Ideally, you should have an aggregate target with one subproject for the library and a subproject for the unit test application. Does the makefile version also build dynamic libraries? If not, your Xcode project should be a static library. Once you get it running, you can (if you want) convert it to a dynamic library.
    If none of these questions really answers your question, you are going to have to delve into the differences in how Xcode builds vs. the makefiles. Dynamic libraries can be particularly difficult to figure out. There isn't any magic setting or Xcode bug. You just have to understand how the build and link process works. Personally, I wouldn't waste any time building Xcode projects for things I didn't write. You'll have to re-do everything the next time you upgrade the software or your system.

  • How do I use a precompiled dylib in my xcode project?

    Hello all you brainiacs out there!
    I want to use mongoDB as my database for my iPhone projects.
    I have compiled their code, with instructions from http://api.mongodb.org/c/current/building.html... successfully.
    I ran all the tests, successfully.
    I have two files, libmongoc.dylib and libbson.dylib generated.
    I have imported them into a brand-new xcode project, (build phases, link binary with libraries, hit '+' sign, add other and browse to these two files)
    I copied the .h files (bson.h and mongo.h) to my project.
    Can I now use the functions in my project as defined to connect, insert, delete.... etc.
    I am a noob at iPhone development (2 months) but I do know what I am doing... (I passed the 2  IOS 5 tests at brainbench.com scoring just under 4/5)
    Can someone walk thru the steps after loading in the dylibs and including the C headers?
    Regards,
    Dan

    Danny Bertrand wrote:
    Is there a list of specific things that you CAN'T do/have to sell on the Apple store?
    The App Store Review guidelines have such a list.
    But rather than focusing on what you can't do, you should focus instead on what you MUST do. One of those "must do" items is comply with any licensing agreements for code or resources you include with your app. It can be quite enlightening to ignore what people say about "open source" and "free software" and actually read those licenses say and research their history. It isn't Apple that is restricting you here . As a wise person once told me - "Follow the money". That will lead you from the Free Software Foundation to academic think tanks and writers right back to .. .some interesting places.
    Welcome to the world of Apple - everybody's bullseye.

  • How do you add files to a target of an Xcode project from the terminal?

    Hi friends.
    I am building a tool to build projects in an automated way. So far it is working great but I can't find a command to add files to a target from the command line.
    Basically what I want to do is the following:
    I have a directory with the XCode project, something like:
    - Classes
    - Images
    - Configuration
    - Etc
    I want to add some files to the folder Images that will be included in the build output.
    Is this possible?
    Thanks!!

    Is this helpful?
    http://www.askdavetaylor.com/fancymac_os_x_command_linetricks.html

  • Soft links and xcode projects

    In other unix environments using soft links ("ln -s") is a handy way of "abstracting away" at the file system level what a file or directory actually contains, so that its contents can be easily changed without having to modify the original file or directory. In other words, if I have eg. three versions of the same file, and several projects share the usage of one of those files, I can easily change which version of the file those projects will use by simply making a softlink that points to the file I want, and make those projects depend on that softlink (they see it as a regular file). If I later want to change the file in question, I only need to change the softlink to point to another version of the file.
    This is especially useful when dealing with a third-party library that gets regular updates. I can install the third-party library somewhere, with the version number of the library in the directory name, and have a more generic directory name as a softlink (as a concrete example, I could have a softlink named "cocos2d" pointing to a directory named "cocos2d-iphone-0.99.5"). If I update the library, I can install it in a new directory (eg. "cocos2d-iphone-1.0.1") and simply change the softlink to point to the new directory, and then recompile the projects that depend on it.
    The problem is that Xcode doesn't like softlinks. I don't know if this is a feature of MacOS X in general, or a quirk in Xcode in particular. The problem is that Xcode doesn't want any softlinks in any of its paths, and instead always resolves where the softlink is really pointing to. Thus if I add, for example, the file "libraries/cocos2d/cocos2d-ios.xcodeproj" to the project, what ends up in the project is actually a reference to "libraries/cocos2d-iphone-0.99.5/cocos2d-ios.xcodeproj". Thus the whole softlink is circumvented, making it useless. If I update the library in question, I have to go through all the projects that use it and change the references to point to the new directory. This causes only needless extra work.
    This resolving of softlinks only happens when adding a new file to the xcode project. Xcode doesn't seem to change them afterwards, if they already exist in the project. In the past I could get around this problem by editing the project file directly with a text editor and forcing the path to refer to the softlink. However, all the paths in xcode 4 projects seem to be obfuscated, making this impossible. Another possibility is to rename the directory in question with the name of the softlink, then add it to the project, then restore its original name and then add the soft link.
    Is there any better way of doing this?

    Hello I have probably exact same problem with source files whereas a constant location (my softlink) points to different version of the sources in a repository. For example:
    ../MyProject/DependantProjetXyz could point to
    ../Repository/DependantProjectXyz/V1.0
    ../Repository/DependantProjectXyz/V1.1
    My xcode project is setup with ../MyProject/DependantProjetXyz which is pretty useful as I don't need to update all the include and lib path everytime I update the dependancies.
    The main problem I am facing is that if I have a compilation error in the dependancies, xcode isn't able to automatically bring me to the error. It simply open the file and position at the very first line in the file. No highlight.
    I am forced to use contextual menu on the error then reveal in the log to find the line number and manually navigate to that line. In other words, I am almost back to good old command line compilation with separate text editor...
    BTW, this was all working fine before upgrade to xcode 4.
    Was a bug filed on this issue?

  • Xcode project questions

    I have just created a new project in xcode.
    Now,I would like to get rid of the files proj_Prefix.pch and projPriv.h , because i don't need them. However, it seems i can't just delete them, because otherwise xcode complains about not finding them.
    In addition, can i get rid of the files projProj.xcconfig and projlTarget.xcconfig ?
    Oh, and one more question: which files of xcode should i put into the SVN repository?
    Thanks a lot in advance.
    Gabriel.

    You have to remove the proj_Prefix.pch and projPriv.h files from the project to delete them safely. In the project window, select the files you want to delete and press the Delete key. An alert opens asking you if you want to delete the references to the files or delete the files and references. Deleting the reference removes the file from the project but keeps it on your hard disk. Deleting the file and reference removes the file from the project and your hard disk. Deleting the reference, then moving the file to the Trash is safer than deleting the file and reference because you can recover the file if you find out you need it.
    You can get rid of the xcconfig files. Those are Xcode configuration files that contain build settings. Configuration files are useful if you make a lot of changes to Xcode's default build settings. By putting the changed settings in a configuration file, you don't have to change the settings in Xcode for every project.
    The point of a SVN repository is to track the changes you make to files. Put the files you need to track in the repository. At a minimum, you should put your source code files in the repository. What works for me is to put everything but the project's build folder in the repository. When I create a Xcode project I want to place under version control, I temporarily move the project's build folder. After importing the project into the repository and checking out the project's files, I move the build folder back with the project.

  • Xcode Project Creation deleted Desktop

    I probably know the answer and do not want to hear what about the backup... etc etc
    I have a MacBook Pro running Yosemite and have Xcode installed. I wanted to do a quick check in Xcode and was not paying attention and went with the defaults it had, well...
    Basically the Xcode project was named Desktop saving in my home directory and therefore replaced my Desktop... I don't really do anything on the machine I wouldn't mind losing as I copy off to other drives and servers etc but would quite like to know why there was perhaps no alert and what it has actually done to my desktop and would quite like to know what was on the desktop.
    I am thinking Data Recovery is the only option but have tried Data Rescue and it recovers files as numerically numbered so will take a while to filter through all the results.
    Any suggestions anyone?

    When I try that here I get
    So no idea why you did not get that alert, perhaps you did and missed it?
    Apart from Data Recovery (or the backup) there isn;t much else you can do at this point.
    regards

  • Xcode project: List of files?

    Is there a way to get a simple list of files out of an xcode project? I just want a plaintext list of the files in a given target so that I can use that in a script that I'm writing. I'd rather not have to parse my way through the XML of the .xcodeproj file...

    The problem with this is that I have 3 projects with 6 targets between them that all use overlapping code-sets.
    So, no one target will use all of the files in a given folder...
    Or did you mean copy and paste the .xcodeproj files? that involves (manually) parsing the XML, which I would rather not do if not necessary..
    Message was edited by: Brian Postow
    Message was edited by: Brian Postow

  • I am in the middle of an xcode project. Can I get back to summary?

    I am in the middle of an xcode project. Can I get back to summary?

    I need to go back and change the default orientation held in summary.  I also need to add icons in. I do this all in summary I believe but cannot see how I get back to it.

  • What can i do when my Xcode project shows me That UIKit/UIKit.h file not found.

    When i going to run my Xcode project on my iPad i got an issue,it was UIKit/UIKit.h file not found. what can i do?

    Unfortunately, this sort of trouble has gotten more complicated to deal with ever since Microsoft pulled the Windows Installer CleanUp utility from their Download Center on June 25. First we have to find a copy of the utility.
    Let's try Googling. (Best not to use Bing, I think.) Look for a working download site for at least version 3.0 of the Windows Installer CleanUp utility. After downloading the utility installer file (msicuu2.exe), scan the file for malware, just in case. (I use the free version of Malwarebytes AntiMalware to do single-file scans for that.)
    If the file is clean, to install the utility, doubleclick the msicuu2.exe file you've downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any Bonjour entries and click "Remove".
    Quit out of CleanUp, restart the PC and try installing iTunes again. Does the install go through properly now?
    (If you do find a clean download site for the correct version of CleanUp, please don't tell me where it is. Without wishing to sound paranoid (although I grant it does sound paranoid), there is a non-zero chance that posting links to download locations for the utility here at Discussions leads to that download location being shut down.)

  • How to undelete xcode project without snapshot and time machine.

    Hi all,
    I really need help on this issue because i accidentally deleted my xcode project.
    Could it be undelete if no time machine snapshot back up?

    Hi Mike.
    Although with the solution described I'd have to unlock everyday but if there are no other ways I'll try that.
    Thanks a lot.

  • How to fix xcodebuild error: The directory /Users/SmilingTornado/ does not contain an Xcode Project

    I am trying to fix my bash but the error: "xcodebuild error: The directory /Users/SmilingTornado/ does not contain an Xcode Project" means that I cant continue to recompile my bash so I have not started the process of patching yet

    OS X bash Update 1.0 – OS X Mavericks

  • Problems with a xcode project

    Hi there,
    I'm trying to compile an existing Xcode project which has used boost library and threadpool library. I have already added the correct header path and library path, and the boost has been successfully compiled(cause the code uses libboost_thread.a).
    Here's my header search path:
    /usr/local/installation/prefix/include(boost header after installed)
    /usr/local/boost1_450
    /Users/niexiao2008/threadpool-025-src/threadpool/boost
    And the library search path is:
    /usr/local/installation/prefix/lib
    I'm sure the boost library has been installed correctly and passed through some test codes, but there's still some problems when buliding the project:
    i686-apple-darwin10-gcc-4.2.1: error trying to exec '/Developer/usr/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/cc1plus': execv: Argument list too long
    Command /Developer/usr/bin/gcc-4.2 failed with exit code 1
    Could someone please help?

    In the Build results window select the compile line that is failing. This should reveal a 'details' icon on the line to the right. Click the icon to display the actual compile command and try to determine why the argument list is too long.

  • Where is best place to save xcode projects?

    Hi,
    I am a newbie on xcode and before I start I have a general question where to save xcode projects the best way?
    Best regards,
    Thomas

    Use whatever is convienient for your skills, resources, budget. Do it now...don't wait and don't use something that you'll just ignore later and stop using.
    At least put up a Time Machine backup...other than that, if you're familiar with SVN/GIT, you can search Xcode Help on: resources ...to see details of putting those into place, etc.

Maybe you are looking for