Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zakkhoyt

macrumors newbie
Original poster
Mar 6, 2009
4
0
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

macrumors 68000
Feb 1, 2005
1,887
1
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 on that.
 

zakkhoyt

macrumors newbie
Original poster
Mar 6, 2009
4
0
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

macrumors newbie
Original poster
Mar 6, 2009
4
0
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.