Assuming you're not wedded to fusty old GCC, deliberately triggering errors in my project so as to get into a position where Xcode will reveal the command line used revealed the following for compilation:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang -x
objective-c -arch armv6 -fmessage-length=0
-fdiagnostics-print-source-range-info -fdiagnostics-show-category=id
-fdiagnostics-parseable-fixits -std=gnu99 -Wno-trigraphs
-fpascal-strings -O0 -Wmissing-prototypes -Wreturn-type -Wparentheses
-Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value
-DDEBUG=1 -isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk
-gdwarf-2 -mthumb "-DIBOutlet=attribute((iboutlet))"
"-DIBOutletCollection(ClassName)=attribute((iboutletcollection(ClassName)))"
"-DIBAction=void)attribute((ibaction)" -miphoneos-version-min=3.2
-iquote [a bookkeeping file] -I[a list of headers] -iquote [more
headers] -I[an include path] -fpch-preprocess -F[pointer to directory
for debug files] -include [my prefix header] -c AppDelegate.m -o
AppDelegate.o
If you're declining the use of Xcode then I guess you can cut the stuff about Interface Builder outlets at the very least. And building for armv6 rather than v7 is probably an error in my project.
And then, to link:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang -arch
armv6 -isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk
-L[something appropriate] -F[something appropriate] -filelist [a
.LinkFileList] -dead_strip -miphoneos-version-min=3.2 -framework
SystemConfiguration -framework UIKit -framework Foundation -framework
CoreGraphics -o [something appropriate]
The .LinkedFileList file seems just to be a list of object files, one per line. Xcode has put the full path to each in there, though I'd guess relative paths to be acceptable.
I appreciate this isn't a full answer, but hopefully it helps?