I'm hacking together a small Cocoa application in XCode. I have all the GUI and events coded up and now I need to integrate a command line tool that I coded up in C a while back. Poking around in the package contents for a few applications I've noticed that it is not uncommon for developers to package up small command line tools within the main Cocoa application. Presumably these command line tools are executed as a new process from the Cocoa application. I'm developing in XCode and have manged to import the source code for the command line tool as say command_line.c. Now, what do I need to do to have this file built as a command line tool that is embedded in the main Cocoa application? Also, how do I exec the command line tool from the Cocoa application? Pointers to any examples would help since my google-fu is not good today.