xCode and compiling

Discussion in 'Mac Programming' started by zakkhoyt, Mar 6, 2009.

  1. zakkhoyt macrumors newbie

    Mar 6, 2009
    Hi guys. I'm working on a static library which is compiled by gcc/make. That library is then used in a cocoa project that I am writing using xcode.

    What I'd like to see is that when I tell xCode "build and go" (or any of those functions) to run the makefile first, then compile the cocoa project. This is pretty easy to do in VS2xxx, but I cannot see where/how to do it in xcode.

  2. Soulstorm macrumors 68000


    Feb 1, 2005
    I can't remember how this is done in Xcode, but have you tried to build the static library first and include that in your project without having to compile it each time?

    I have written an article on that.
  3. zakkhoyt thread starter macrumors newbie

    Mar 6, 2009
    Well, I do have the static library included as part of the project (as the cocoa app must link to it), but I'm developing the library in parallel with the cocoa app.
  4. zakkhoyt thread starter macrumors newbie

    Mar 6, 2009
    The answer is actually quite simple. Either under Project -> New Build Phase , or with the context menu of you're target, tell it to add a New Run Script Build Phase. The top field is the shelling program (default to /bin/sh), then you enter your script. You can do this, or add scripts under the "run script" directory it creates.

    I personally am using to run a makefile. I am at a loss of how to view the output however. Halfway there :)


Share This Page