21

Say I've got an Xcode project on a linux machine and I want to, like I can do on the Mac, install & use xcodebuild to simply compile the project, not to run it or anything fancy, just simply to compile it to check for errors.

Is it possible to install xcodebuild on a Linux machine or is it entirely out of the question, if so what are my alternatives?

jscs
  • 63,694
  • 13
  • 151
  • 195
Joshua
  • 15,200
  • 21
  • 100
  • 172
  • No, use a Makefile or one of the many IDEs available on Linux. Are you trying to cross-compile OSX/iOS code, or simply natively compile a cross-platform app on Linux? – Adam Rosenfield Jun 28 '12 at 19:18
  • I simply want to compile an Xcode project containing Mac/iOS objective-c code on Linux. – Joshua Jun 28 '12 at 19:45

1 Answers1

6

You can't use the standard Apple developer tools on Linux, because they're compiled for Mac OS X.

If you're compiling for iOS, you can, however, build an opensource iOS toolchain for linux and use it for compiling your app. You'll need a jailbroken device to upload the binary, though.

If you're working with a normal OS X application, then, provided you have the necessary libraries and frameworks, you can build the project for Linux using make.

  • Could you give me any further information on installing the libraries and using make specifically for mac applications? – Joshua Jun 28 '12 at 19:42
  • Well - there's nothing special. You can maybe have a look a Cocotron. And a quick makefile tutorial. –  Jun 28 '12 at 19:43
  • I dont know if Cocotrom is really what I'm looking for, all I want to do is compile the code for errors not to create a resulting application. – Joshua Jun 28 '12 at 19:46
  • Then you can just install gobjc (GCC Objective-C frontend) and run it with the `-c` option to see if there are any errors. –  Jun 28 '12 at 19:49
  • Does that build the whole project or individual files? As building the whole project would be more convenient. – Joshua Jun 28 '12 at 19:55
  • You can use make to build the whole project. –  Jun 28 '12 at 20:17
  • When I type `make` in the terminal I get the following error: `make: *** No targets specified and no makefile found. Stop.`. – Joshua Jun 29 '12 at 15:11
  • Well, that's not that simple. You have to write a makefile. (why do you think I instructed you to search for a Makefile tutorial?) –  Jun 29 '12 at 15:12
  • Sorry H2C03 did not read the last part of that comment. My apologies. – Joshua Jun 29 '12 at 15:24
  • No problem, it happens sometimes. –  Jun 29 '12 at 15:47