Sunday, March 8, 2009, 04:21 PM - Resources
Posted by Administrator
Most if not all of the sample apps provided with the iphone SDK use a prefix.pch file which, under Xcode would be handled as a precompiled prefix header included with all source files.Posted by Administrator
I searched all over to see if anyone had already handled it but come up empty.
This is what I came up with to properly include the prefix header and also have it precompiled.
%.o: %.m Prefix.pch.gch
$(CC) -include Prefix.pch -c $(CFLAGS) $< -o $@
%.o: %.cpp Prefix.pch.gch
$(CXX) -include Prefix.pch -c $(CXXFLAGS) $< -o $@
Prefix.pch.gch: Prefix.pch
$(CC) -x objective-c-header $(CFLAGS) Prefix.pch
It adds the Prefix.pch.gch as a dependence and then includes it when creating an object file.

Calendar


