1

I'm trying to build an Xcode project with GNUStep-make. Right now the project is very small (3 classes) however it will grow to hundreds of classes over the coming weeks so I'm trying to get everything figured out and well-organised now.

Xcode creates a ProjectName_Prefix.pch file which is a header that: a) get precompiled and b) is prefixed to every file in my project; at least if I understand correctly.

Now, how do I tell GNUStep-make what to do with this file when it builds? I've added it to the XXX_PRECOMPILED_HEADERS variable.

Cioccolata_OBJC_PRECOMPILED_HEADERS = Cioccolata_Prefix.pch

With this in place the build fails with the error:

Making all for framework Cioccolata...
make[1]: *** No rule to make target `/Users/chris/Projects/Mac/Cioccolata/build/GNUStep/obj/PrecompiledHeaders/ObjC/Cioccolata_Prefix.pch', needed by `internal-precompile-headers'.  Stop.
make: *** [Cioccolata.all.framework.variables] Error 2

I've also got the following in my makefile:

ADDITIONAL_OBJC_FLAGS += -include Cioccolata_Prefix.pch -Winvalid-pch

I'm not sure what I've done wrong here. I basically have tried to follow the GNUStep documentation for precompiled headers.

None of my project's source files expressly include the Foundation framework since this header does that.

d11wtq
  • 34,788
  • 19
  • 120
  • 195
  • Can you compile something *without* the pch file? Just some simple test class..? In general, people on the GNUstep list are very helpful, and few people on SO seem to know much about GNUstep, so I'd advice you to ask there. (I, for one, can't answer your question.) – Felixyz Apr 23 '10 at 15:57
  • Provided that I edit each of my .m files to add the contents of the .pch file, then yes it builds correctly. However I'd like to understand how to use the precompiled header with GNUStep since this is a feature that is apparently supported. – d11wtq Apr 23 '10 at 16:06
  • Looking at Xcode's transcript, it passes `-x objective-c-header` to gcc when it precompiles the header. I'm not sure how to do that just for the precompiled headers build phase with GNUStep-make. – d11wtq Apr 24 '10 at 01:33
  • I figured it out. There were two issues that I noticed from looking through the makefiles: 1) The extension .pch is not supported since it has a hard-coded .h. I might patch this. 2) ADDITIONAL_OBJC_FLAGS was supposed to be ADDITIONAL_OBJCFLAGS. I've just renamed the .pch in my Xcode project so it uses .h for compat reasons. I'm now going to try patching the makefiles to allow .pch though. – d11wtq Apr 24 '10 at 02:04
  • I have successfully patched the makefiles to support .h and .pch interchangeably. The patch has been submitted to the dev list. Hopefully it finds it way into the project. – d11wtq Apr 24 '10 at 02:39

1 Answers1

1

Thanks for pointing our attention to this problem and for your patch! :-)

This is now fixed on gnustep-make trunk, and so will be fixed in gnustep-make 2.4.0 once released.

Nicola Pero (gnustep-make)

Nicola
  • 26
  • 1