PDA

View Full Version : xCode and compiling




zakkhoyt
Mar 6, 2009, 11:31 AM
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.

Thx



Soulstorm
Mar 6, 2009, 11:44 AM
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.

Thx

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 (http://www.soulstorm-creations.com/PROJECT_SOULSTORM_2_0/programming-articles/installing-portable-libraries-on-os-x.html) on that.

zakkhoyt
Mar 6, 2009, 12:15 PM
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.

zakkhoyt
Mar 6, 2009, 01:06 PM
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 :)


-Zakk