Yesterday I wanted to compile a .c code for ARM architecture using the iOS SDK on my Lion machine. I wanted to create object files and executable files that I can install on my jailbroken iPhone 4. I have explained the process here for you. I hope it will be of help.

We are going to be using the LLVM-GCC compiler. In OS X Lion, this compiler sits here:

Also we need to pass the path to our iOS SDK, to the compiler so that it knows where to get the libraries and frameworks from. In OS X Lion with iOS SDK 5.1 installed, the path of the iOS SDK would be here: